fix: remove the DisableSearchHistory and DisableSearchHighlights switches (#800)

This commit is contained in:
HetCreep
2026-10-08 21:59:54 +02:00
committed by GitHub
parent 386ae0c581
commit 5ca1b7001b
9 changed files with 24 additions and 4 deletions
+24
View File
@@ -104,4 +104,28 @@ Describe 'FeatureId parameter contracts' {
$missing | Should -HaveCount 0 -Because ($missing -join ', ')
}
It 'accounts for every Win11Debloat.ps1 parameter as a FeatureId or a control parameter' {
$tokens = $null
$parseErrors = $null
$ast = [System.Management.Automation.Language.Parser]::ParseFile($script:Win11DebloatPath, [ref]$tokens, [ref]$parseErrors)
$parseErrors | Should -BeNullOrEmpty
$assignment = $ast.Find({
param($node)
$node -is [System.Management.Automation.Language.AssignmentStatementAst] -and $node.Left.Extent.Text -eq '$script:ControlParams'
}, $true)
$assignment | Should -Not -BeNullOrEmpty
$controlParameters = @(
$assignment.Right.FindAll({ param($node) $node -is [System.Management.Automation.Language.StringConstantExpressionAst] }, $true) |
ForEach-Object { $_.Value }
)
$unaccounted = @(
Get-ScriptParameterNames -Path $script:Win11DebloatPath |
Where-Object { $script:Features.FeatureId -notcontains $_ -and $controlParameters -notcontains $_ }
)
$unaccounted | Should -HaveCount 0 -Because ($unaccounted -join ', ')
}
}