Files
Win11Debloat/Scripts/Features/EnableWindowsFeature.ps1
Jeffrey ad0b49060a Add option to disable MS Store app results in Windows Search (#509)
This also includes:

* Update README for DisableSearchHighlights and DisableFindMyDevice

* Extracted more logic from main script into separate scripts

* Add event handler for tab changes to regenerate overview
2026-03-07 20:28:48 +01:00

16 lines
513 B
PowerShell

# Enables a Windows optional feature and pipes its output to the console
function EnableWindowsFeature {
param (
[string]$FeatureName
)
$result = Invoke-NonBlocking -ScriptBlock {
param($name)
Enable-WindowsOptionalFeature -Online -FeatureName $name -All -NoRestart
} -ArgumentList $FeatureName
$dismResult = @($result) | Where-Object { $_ -is [Microsoft.Dism.Commands.ImageObject] }
if ($dismResult) {
Write-Host ($dismResult | Out-String).Trim()
}
}