From ee3c2be6c5a63d7c8955731f813352f86dab98e6 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Sun, 13 Sep 2026 00:18:07 +0000 Subject: [PATCH 1/3] Bump Pester to 6.1 --- requirements.psd1 | 2 +- tests/Get-PlasterManifestPathForCulture.Tests.ps1 | 1 + tests/Help.tests.ps1 | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.psd1 b/requirements.psd1 index e401e1c..35173ff 100644 --- a/requirements.psd1 +++ b/requirements.psd1 @@ -6,7 +6,7 @@ Target = 'CurrentUser' } 'Pester' = @{ - Version = '5.7.1' + Version = '6.1.0' Parameters = @{ SkipPublisherCheck = $true } diff --git a/tests/Get-PlasterManifestPathForCulture.Tests.ps1 b/tests/Get-PlasterManifestPathForCulture.Tests.ps1 index 40be779..2938897 100644 --- a/tests/Get-PlasterManifestPathForCulture.Tests.ps1 +++ b/tests/Get-PlasterManifestPathForCulture.Tests.ps1 @@ -39,6 +39,7 @@ Describe 'Get-PlasterManifestPathForCulture' { It "falls back to invariant culture manifest if no specific match is found" { $culture = New-Object System.Globalization.CultureInfo("xx-XX") + Mock -CommandName 'Test-Path' -MockWith { $False } Mock -CommandName 'Test-Path' -MockWith { $False } -ParameterFilter { $Path -like "*en-US*" } Mock -CommandName 'Test-Path' -MockWith { $True } -ParameterFilter { $Path -like "*fr-FR*" } Mock -CommandName 'Test-Path' -MockWith { $True } -ParameterFilter { $Path -like "*plasterManifest.xml" } diff --git a/tests/Help.tests.ps1 b/tests/Help.tests.ps1 index c9fc3e0..56fdc79 100644 --- a/tests/Help.tests.ps1 +++ b/tests/Help.tests.ps1 @@ -80,7 +80,7 @@ Describe "Test help for <_.Name>" -ForEach $commands { ($commandHelp.Examples.Example.Remarks | Select-Object -First 1).Text | Should -Not -BeNullOrEmpty } - It "Help link <_> is valid" -ForEach $helpLinks { + It "Help link <_> is valid" -ForEach $helpLinks -AllowNullOrEmptyForEach { (Invoke-WebRequest -Uri $_ -UseBasicParsing).StatusCode | Should -Be '200' } @@ -115,7 +115,7 @@ Describe "Test help for <_.Name>" -ForEach $commands { } } - Context "Test <_> help parameter help for " -ForEach $helpParameterNames { + Context "Test <_> help parameter help for " -ForEach $helpParameterNames -AllowNullOrEmptyForEach { # Shouldn't find extra parameters in help. It "finds help parameter in code: <_>" { From 875a7b45e575812730030e336f4f09b67e78ef80 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Sun, 13 Sep 2026 00:22:16 +0000 Subject: [PATCH 2/3] Avoid reimporting Pester during bootstrap --- build.ps1 | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/build.ps1 b/build.ps1 index 2e1aa2e..60945d5 100644 --- a/build.ps1 +++ b/build.ps1 @@ -84,28 +84,18 @@ if ($Bootstrap) { ErrorAction = 'Stop' } - $importSucceeded = $false - try { - Invoke-PSDepend @psDependParameters - $importSucceeded = $true - Write-Verbose 'Successfully imported existing modules.' -Verbose - } catch { - Write-Verbose "Could not import all required modules: $_" -Verbose - Write-Verbose 'Attempting to install missing or outdated dependencies...' -Verbose - } + $psDependTestParameters = $psDependParameters.Clone() + $null = $psDependTestParameters.Remove('Import') + $psDependTestParameters['Test'] = $true + $psDependTestParameters['Quiet'] = $true - if (-not $importSucceeded) { - try { - Invoke-PSDepend @psDependParameters -Install - } catch { - Write-Error "Failed to install and import required dependencies: $_" - Write-Error 'This may be due to locked module files. Please restart the build environment or clear module locks.' - if ($_.Exception.InnerException) { - Write-Error "Inner exception: $($_.Exception.InnerException.Message)" - } - throw - } + if (-not (Invoke-PSDepend @psDependTestParameters)) { + $psDependInstallParameters = $psDependParameters.Clone() + $null = $psDependInstallParameters.Remove('Import') + Invoke-PSDepend @psDependInstallParameters -Install } + + Invoke-PSDepend @psDependParameters } else { if (-not (Get-Module -Name 'PSDepend' -ListAvailable)) { throw 'Missing dependencies. Please run with the "-Bootstrap" flag to install dependencies.' From 0b3bd1a726f8c97ad87adb82779e17a93742baba Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Sun, 13 Sep 2026 00:28:29 +0000 Subject: [PATCH 3/3] Bump Pester to 6.2 --- requirements.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.psd1 b/requirements.psd1 index 35173ff..0526ea7 100644 --- a/requirements.psd1 +++ b/requirements.psd1 @@ -6,7 +6,7 @@ Target = 'CurrentUser' } 'Pester' = @{ - Version = '6.1.0' + Version = '6.2.0' Parameters = @{ SkipPublisherCheck = $true }