diff --git a/Regfiles/Disable_Search_Highlights.reg b/Regfiles/Disable_Search_Highlights.reg deleted file mode 100644 index 83f8d47..0000000 Binary files a/Regfiles/Disable_Search_Highlights.reg and /dev/null differ diff --git a/Regfiles/Disable_Search_History.reg b/Regfiles/Disable_Search_History.reg deleted file mode 100644 index 1815893..0000000 Binary files a/Regfiles/Disable_Search_History.reg and /dev/null differ diff --git a/Regfiles/Sysprep/Disable_Search_Highlights.reg b/Regfiles/Sysprep/Disable_Search_Highlights.reg deleted file mode 100644 index 90c5351..0000000 Binary files a/Regfiles/Sysprep/Disable_Search_Highlights.reg and /dev/null differ diff --git a/Regfiles/Sysprep/Disable_Search_History.reg b/Regfiles/Sysprep/Disable_Search_History.reg deleted file mode 100644 index 5b3cbdf..0000000 Binary files a/Regfiles/Sysprep/Disable_Search_History.reg and /dev/null differ diff --git a/Regfiles/Undo/Enable_Search_Highlights.reg b/Regfiles/Undo/Enable_Search_Highlights.reg deleted file mode 100644 index d8946c3..0000000 Binary files a/Regfiles/Undo/Enable_Search_Highlights.reg and /dev/null differ diff --git a/Regfiles/Undo/Enable_Search_History.reg b/Regfiles/Undo/Enable_Search_History.reg deleted file mode 100644 index 33937fb..0000000 Binary files a/Regfiles/Undo/Enable_Search_History.reg and /dev/null differ diff --git a/Scripts/Get.ps1 b/Scripts/Get.ps1 index fb39bf2..e1d2f6b 100644 --- a/Scripts/Get.ps1 +++ b/Scripts/Get.ps1 @@ -27,7 +27,6 @@ param ( [switch]$EnableWindowsSandbox, [switch]$EnableWindowsSubsystemForLinux, [switch]$DisableTelemetry, - [switch]$DisableSearchHistory, [switch]$DisableFastStartup, [switch]$DisableBitlockerAutoEncryption, [switch]$DisableModernStandbyNetworking, @@ -73,7 +72,6 @@ param ( [switch]$DisableNotepadAI, [switch]$DisableEdgeAI, [switch]$DisableChromeAI, - [switch]$DisableSearchHighlights, [switch]$DisableWidgets, [switch]$HideChat, [switch]$EnableEndTask, diff --git a/Tests/FeatureParameterContracts.Tests.ps1 b/Tests/FeatureParameterContracts.Tests.ps1 index e991457..167f354 100644 --- a/Tests/FeatureParameterContracts.Tests.ps1 +++ b/Tests/FeatureParameterContracts.Tests.ps1 @@ -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 ', ') + } } diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 572cb0e..2358546 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -25,7 +25,6 @@ param ( [switch]$EnableWindowsSandbox, [switch]$EnableWindowsSubsystemForLinux, [switch]$DisableTelemetry, - [switch]$DisableSearchHistory, [switch]$DisableFastStartup, [switch]$DisableBitlockerAutoEncryption, [switch]$DisableModernStandbyNetworking, @@ -37,7 +36,6 @@ param ( [switch]$DisableBing, [switch]$DisableNotifications, [switch]$DisableStoreSearchSuggestions, - [switch]$DisableSearchHighlights, [switch]$DisableDesktopSpotlight, [switch]$HideDesktopSpotlightIcon, [switch]$EnableDesktopSpotlight,