Skip to content
15 changes: 2 additions & 13 deletions source/dbachecks.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ if ((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsPowerShell\dbacheck
if ((Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\WindowsPowerShell\dbachecks\System" -Name "DoDotSource" -ErrorAction Ignore).DoDotSource) { $script:doDotSource = $true }

# Execute Preimport actions
if($IsLinux){
Write-Verbose "Loading preimport in linux"
. Import-ModuleFile -Path "$ModuleRoot/internal/scripts/preimport.ps1"
}else{
. Import-ModuleFile -Path "$ModuleRoot\internal\scripts\preimport.ps1"
}

. Import-ModuleFile -Path (Convert-Path -Path "$ModuleRoot\internal\scripts\preimport.ps1")

# Import all internal functions
foreach ($function in (Get-ChildItem "$ModuleRoot\internal\functions\*.ps1")) {
Expand All @@ -45,12 +39,7 @@ foreach ($function in (Get-ChildItem "$ModuleRoot\functions\*.ps1")) {
}

# Execute Postimport actions
if($IsLinux){
Write-Verbose "Loading postimport in linux"
. Import-ModuleFile -Path "$ModuleRoot/internal/scripts/postimport.ps1"
}else{
. Import-ModuleFile -Path "$ModuleRoot\internal\scripts\postimport.ps1"
}
. Import-ModuleFile -Path (Convert-Path -Path "$ModuleRoot\internal\scripts\postimport.ps1")

if (-not (Test-Path Alias:Update-Dbachecks)) { Set-Alias -Scope Global -Name 'Update-Dbachecks' -Value 'Update-DbcRequiredModules' }
$VerbosePreference = "SilentlyContinue"