From 9bf94b7809f2d217269b85ffbcf9ec89b092e528 Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Sun, 20 Oct 2024 23:28:46 +0200 Subject: [PATCH] oops fix --- dbatools.psm1 | 5 +++++ private/testing/Get-TestConfig.ps1 | 2 +- tests/constants.ps1 | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dbatools.psm1 b/dbatools.psm1 index 1ec91a8a1a..034f6c1a5c 100644 --- a/dbatools.psm1 +++ b/dbatools.psm1 @@ -166,6 +166,11 @@ if (-not (Test-Path -Path "$script:PSModuleRoot\dbatools.dat") -or $script:seria . $file.FullName } + # All internal functions privately available within the toolset + foreach ($file in (Get-ChildItem -Path "$script:PSModuleRoot/private/testing/" -Recurse -Filter *.ps1)) { + . $file.FullName + } + Write-ImportTime -Text "Loading internal commands via dotsource" # All exported functions diff --git a/private/testing/Get-TestConfig.ps1 b/private/testing/Get-TestConfig.ps1 index 5167c8a37d..cd7e8d38cd 100644 --- a/private/testing/Get-TestConfig.ps1 +++ b/private/testing/Get-TestConfig.ps1 @@ -1,5 +1,5 @@ function Get-TestConfig { - params( + param( [string]$LocalConfigPath = "$script:PSModuleRoot/tests/constants.local.ps1" ) $config = [ordered]@{} diff --git a/tests/constants.ps1 b/tests/constants.ps1 index ac72ebc2ea..88f8241fe4 100644 --- a/tests/constants.ps1 +++ b/tests/constants.ps1 @@ -1,3 +1,4 @@ +return # constants if (Test-Path "$TestConfig.PSModuleRoot/tests/constants.local.ps1") { Write-Host "Tests will use local constants file: tests\constants.local.ps1." -ForegroundColor Cyan