From cf9daeb49af176942972e2eaa10d6a43d3996837 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 12 Feb 2026 08:50:16 -0800 Subject: [PATCH 1/2] Update the `Update-Help` tests to use `-Force` to remove read-only files (#26780) --- .../engine/Help/UpdatableHelpSystem.Tests.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 index 439dc3be989..b43e5d7f7b9 100644 --- a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 @@ -215,17 +215,19 @@ function RunUpdateHelpTests It ('Validate Update-Help for module ''{0}'' in {1}' -F $moduleName, [PSCustomObject] $updateScope) -Skip:(!(Test-CanWriteToPsHome) -and $userscope -eq $false) { # Delete the whole help directory - Remove-Item ($moduleHelpPath) -Recurse - + Remove-Item ($moduleHelpPath) -Recurse -Force -ErrorAction SilentlyContinue + [hashtable] $UICultureParam = $(if ((Get-UICulture).Name -ne $myUICulture) { @{ UICulture = $myUICulture } } else { @{} }) [hashtable] $sourcePathParam = $(if ($useSourcePath) { @{ SourcePath = Join-Path $PSScriptRoot assets } } else { @{} }) - Update-Help -Module:$moduleName -Force @UICultureParam @sourcePathParam -Scope:$updateScope + Update-Help -Module:$moduleName -Force @UICultureParam @sourcePathParam -Scope:$updateScope -ErrorAction Stop [hashtable] $userScopeParam = $(if ($userscope) { @{ UserScope = $true } } else { @{} }) ValidateInstalledHelpContent -moduleName:$moduleName @userScopeParam + } + if ($tag -eq "CI") { break @@ -457,4 +459,4 @@ Describe "Validate 'Save-Help -DestinationPath for all PowerShell modules." -Tag $ProgressPreference = $SavedProgressPreference } RunSaveHelpTests -Tag "Feature" -} +} \ No newline at end of file From d5fa04325701a14b7c5ef9ac22d4b15e51f622b2 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 12 Feb 2026 12:03:57 -0500 Subject: [PATCH 2/2] Apply suggestion from @TravisEz13 --- test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 index b43e5d7f7b9..06128caa85f 100644 --- a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 @@ -459,4 +459,4 @@ Describe "Validate 'Save-Help -DestinationPath for all PowerShell modules." -Tag $ProgressPreference = $SavedProgressPreference } RunSaveHelpTests -Tag "Feature" -} \ No newline at end of file +}