dbatools.ai.psm1
$script:ModuleRoot = $PSScriptRoot $script:dbSchema = @{} $script:foreignKeyCache = @{} $script:dbassist = {} $script:threadcache = @{} function Import-ModuleFile { [CmdletBinding()] Param ( [string] $Path ) if ($doDotSource) { . $Path } else { $ExecutionContext.InvokeCommand.InvokeScript($false, ([scriptblock]::Create([io.file]::ReadAllText($Path))), $null, $null) } } # Import all internal functions foreach ($function in (Get-ChildItem "$ModuleRoot\private\" -Filter "*.ps1" -Recurse -ErrorAction Ignore)) { . Import-ModuleFile -Path $function.FullName } # Import all public functions foreach ($function in (Get-ChildItem "$ModuleRoot\public" -Filter "*.ps1" -Recurse -ErrorAction Ignore)) { . Import-ModuleFile -Path $function.FullName } # Create powershell alias called dbai for Invoke-DbaiQuery Set-Alias -Name dbai -Value Invoke-DbaiQuery Set-Alias -Name dtai -Value Invoke-DbatoolsAI |