File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- function Toggle -Feature {
1
+ function Update -Feature {
2
2
param (
3
3
[string ]$featureName ,
4
4
[bool ]$bool
@@ -9,7 +9,7 @@ function Toggle-Feature {
9
9
10
10
$dismCmd = if ($bool ) { " Enable" } else { " Disable" }
11
11
12
- if ($regKey -eq $null -or ($regKey.Selection -eq 0 -and $bool ) -or ($regKey.Selection -eq 1 -and ! $bool )) {
12
+ if ($null -eq $regKey -or ($regKey.Selection -eq 0 -and $bool ) -or ($regKey.Selection -eq 1 -and ! $bool )) {
13
13
Write-Host " $dismCmd $featureName "
14
14
if ($bool ) {
15
15
Enable-WindowsOptionalFeature - Online - FeatureName $featureName - NoRestart - All
@@ -20,7 +20,7 @@ function Toggle-Feature {
20
20
}
21
21
22
22
23
- $featuresToToggle = @ (
23
+ $features = @ (
24
24
@ { Name = " DirectPlay" ; Bool = $true },
25
25
@ { Name = " LegacyComponents" ; Bool = $true },
26
26
@ { Name = " MicrosoftWindowsPowerShellV2" ; Bool = $false },
@@ -31,6 +31,6 @@ $featuresToToggle = @(
31
31
@ { Name = " WorkFolders-Client" ; Bool = $false }
32
32
# @{ Name = "SmbDirect"; Bool = $false }
33
33
)
34
- foreach ($feature in $featuresToToggle ) {
35
- Toggle - Feature - featureName $feature.Name - bool $feature.Bool
34
+ foreach ($feature in $features ) {
35
+ Update -Feature - featureName $feature.Name - bool $feature.Bool
36
36
}
You can’t perform that action at this time.
0 commit comments