diff --git a/requirements.psd1 b/requirements.psd1 index c7e5de0..3f920f5 100755 --- a/requirements.psd1 +++ b/requirements.psd1 @@ -9,7 +9,7 @@ SkipPublisherCheck = $true } } - psake = '4.9.0' + psake = '5.0.4' PSScriptAnalyzer = '1.25.0' InvokeBuild = '5.14.23' platyPS = '0.14.2' diff --git a/tests/Manifest.tests.ps1 b/tests/Manifest.tests.ps1 index b659654..4150b20 100644 --- a/tests/Manifest.tests.ps1 +++ b/tests/Manifest.tests.ps1 @@ -1,5 +1,10 @@ BeforeAll { - Set-BuildEnvironment -Force + # Only call Set-BuildEnvironment when the build variables are not already present. + # build.ps1 sets them before Invoke-psake, so inside a build this is a no-op; standalone + # Pester runs still get them. Calling it unconditionally lets an escaping 'break' from + # BuildHelpers' Get-BuildVariable switch blocks unwind out of this BeforeAll, which + # psake 4.9.x absorbs but psake 5.x does not -- Pester then fails the whole container. + if (-not $env:BHProjectName) { Set-BuildEnvironment -Force } $moduleName = $env:BHProjectName $manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest $outputDir = Join-Path -Path $ENV:BHProjectPath -ChildPath 'Output'