mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-04-03 22:16:30 +00:00
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
16 lines
513 B
PowerShell
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()
|
|
}
|
|
} |