Skip to content

Commit

Permalink
Changed function name in DISM-FEATURES.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
melo936 authored Dec 7, 2023
1 parent 16fb0ea commit 582eaa9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Executables/DISM-FEATURES.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Toggle-Feature {
function Update-Feature {
param(
[string]$featureName,
[bool]$bool
Expand All @@ -9,7 +9,7 @@ function Toggle-Feature {

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

if ($regKey -eq $null -or ($regKey.Selection -eq 0 -and $bool) -or ($regKey.Selection -eq 1 -and !$bool)) {
if ($null -eq $regKey -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 -All
Expand All @@ -20,7 +20,7 @@ function Toggle-Feature {
}


$featuresToToggle = @(
$features = @(
@{ Name = "DirectPlay"; Bool = $true },
@{ Name = "LegacyComponents"; Bool = $true },
@{ Name = "MicrosoftWindowsPowerShellV2"; Bool = $false },
Expand All @@ -31,6 +31,6 @@ $featuresToToggle = @(
@{ Name = "WorkFolders-Client"; Bool = $false }
# @{ Name = "SmbDirect"; Bool = $false }
)
foreach ($feature in $featuresToToggle) {
Toggle-Feature -featureName $feature.Name -bool $feature.Bool
foreach ($feature in $features) {
Update-Feature -featureName $feature.Name -bool $feature.Bool
}

0 comments on commit 582eaa9

Please sign in to comment.