refactor: rename NoRestartExplorer parameter to SkipExplorerRestart (#709)

The old `NoRestartExplorer` parameter is kept as an alias and will
continue to work, but is considered deprecated
This commit is contained in:
Jeffrey
2026-07-19 22:58:03 +02:00
committed by GitHub
parent 9c033dbf98
commit a9c1736e46
7 changed files with 20 additions and 9 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ Describe 'Import-ConfigToParams' {
$script:Params[$featureId] | Should -BeTrue
}
$script:Params['CreateRestorePoint'] | Should -BeTrue
$script:Params['NoRestartExplorer'] | Should -BeTrue
$script:Params['SkipExplorerRestart'] | Should -BeTrue
$script:Params.ContainsKey('User') | Should -BeFalse
$script:Params.ContainsKey('AppRemovalTarget') | Should -BeFalse
}
+10 -1
View File
@@ -56,12 +56,21 @@ Describe 'Test-ModernStandbySupport' {
Mock Stop-Process {}
$script:Params = @{ WhatIf = $true }
Invoke-RestartExplorer
$script:Params = @{ NoRestartExplorer = $true }
$script:Params = @{ SkipExplorerRestart = $true }
Invoke-RestartExplorer
Should -Invoke Stop-Process -Times 0 -Exactly
}
It 'treats NoRestartExplorer as a backward-compatible alias for SkipExplorerRestart' {
# Verify the alias is declared on Win11Debloat.ps1's canonical parameter,
# so legacy callers using -NoRestartExplorer continue to work without code duplication.
$command = Get-Command (Join-Path $PSScriptRoot '..\Win11Debloat.ps1')
$skipParam = $command.Parameters['SkipExplorerRestart']
$skipParam | Should -Not -BeNullOrEmpty
$skipParam.Aliases | Should -Contain 'NoRestartExplorer'
}
It 'restarts Explorer when allowed and reports reboot-required features' {
Mock Stop-Process {}
Mock Get-RebootFeatureLabels { @('Disable telemetry') }