WindowsOptionalFeatures script improvements

This commit is contained in:
h3r0 2023-12-03 12:17:32 +00:00 committed by GitHub
parent 6b2f63d0d1
commit b4e71acfc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ function Toggle-Feature {
if ($regKey -eq $null -or ($regKey.Selection -eq 0 -and $bool) -or ($regKey.Selection -eq 1 -and !$bool)) {
Write-Host "$dismCmd $featureName"
if ($bool) {
Enable-WindowsOptionalFeature -Online -FeatureName $featureName -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName $featureName -NoRestart -All
} else {
Disable-WindowsOptionalFeature -Online -FeatureName $featureName -NoRestart
}
@ -28,8 +28,8 @@ $featuresToToggle = @(
@{ Name = "MSRDC-Infrastructure"; Bool = $false },
@{ Name = "Printing-Foundation-Features"; Bool = $false },
@{ Name = "Printing-Foundation-InternetPrinting-Client"; Bool = $false },
@{ Name = "WorkFolders-Client"; Bool = $false },
@{ Name = "SmbDirect"; Bool = $false }
@{ Name = "WorkFolders-Client"; Bool = $false }
# @{ Name = "SmbDirect"; Bool = $false }
)
foreach ($feature in $featuresToToggle) {
Toggle-Feature -featureName $feature.Name -bool $feature.Bool