mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-08-22 07:36:25 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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') }
|
||||
|
||||
Reference in New Issue
Block a user