Skip to content

Commit 582eaa9

Browse files
authored
Changed function name in DISM-FEATURES.ps1
1 parent 16fb0ea commit 582eaa9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Executables/DISM-FEATURES.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Toggle-Feature {
1+
function Update-Feature {
22
param(
33
[string]$featureName,
44
[bool]$bool
@@ -9,7 +9,7 @@ function Toggle-Feature {
99

1010
$dismCmd = if ($bool) { "Enable" } else { "Disable" }
1111

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)) {
1313
Write-Host "$dismCmd $featureName"
1414
if ($bool) {
1515
Enable-WindowsOptionalFeature -Online -FeatureName $featureName -NoRestart -All
@@ -20,7 +20,7 @@ function Toggle-Feature {
2020
}
2121

2222

23-
$featuresToToggle = @(
23+
$features = @(
2424
@{ Name = "DirectPlay"; Bool = $true },
2525
@{ Name = "LegacyComponents"; Bool = $true },
2626
@{ Name = "MicrosoftWindowsPowerShellV2"; Bool = $false },
@@ -31,6 +31,6 @@ $featuresToToggle = @(
3131
@{ Name = "WorkFolders-Client"; Bool = $false }
3232
# @{ Name = "SmbDirect"; Bool = $false }
3333
)
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
3636
}

0 commit comments

Comments
 (0)