Skip to content

Commit

Permalink
Removed trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
HotCakeX committed Dec 14, 2023
1 parent 2c6c810 commit 561ef3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1966,11 +1966,11 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
[parameter(Mandatory = $true, ParameterSetName = 'Capability')]
[System.String]$CapabilityName,
[parameter(Mandatory = $true, ParameterSetName = 'Feature')]
[System.String]$FeatureName,
[System.String]$FeatureName,
[parameter(Mandatory = $true, ParameterSetName = 'Feature')]
[ValidateSet('Enabling', 'Disabling')]
[System.String]$FeatureAction
)
)
switch ($Type) {
'Feature' {
if ($FeatureAction -eq 'Enabling') {
Expand All @@ -1991,7 +1991,7 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
Disable-WindowsOptionalFeature -Online -FeatureName $FeatureName -NoRestart -ErrorAction Stop
}
# Shows the successful message only if the process was successful
Write-Host -Object "$FeatureName was successfully $ActionOutput" -ForegroundColor Green
Write-Host -Object "$FeatureName was successfully $ActionOutput" -ForegroundColor Green
}
catch {
# show errors in non-terminating way
Expand All @@ -2006,7 +2006,7 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
'Capability' {
Write-Host -Object "`nRemoving $CapabilityName" -ForegroundColor Yellow
if ((Get-WindowsCapability -Online | Where-Object -FilterScript { $_.Name -like "*$CapabilityName*" }).state -ne 'NotPresent') {
try {
try {
Get-WindowsCapability -Online | Where-Object -FilterScript { $_.Name -like "*$CapabilityName*" } | Remove-WindowsCapability -Online -ErrorAction Stop
# Shows the successful message only if the process was successful
Write-Host -Object "$CapabilityName was successfully removed." -ForegroundColor Green
Expand All @@ -2020,7 +2020,7 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
Write-Host -Object "$CapabilityName is already removed." -ForegroundColor Green
}
break
}
}
}
}
Edit-Addons -Type Feature -FeatureAction Disabling -FeatureName 'MicrosoftWindowsPowerShellV2'
Expand All @@ -2038,7 +2038,7 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
Edit-Addons -Type Capability -CapabilityName 'Microsoft.Windows.WordPad'
Edit-Addons -Type Capability -CapabilityName 'Microsoft.Windows.PowerShell.ISE'
Edit-Addons -Type Capability -CapabilityName 'App.StepsRecorder'

# Uninstall VBScript that is now uninstallable as an optional features since Windows 11 insider Dev build 25309 - Won't do anything in other builds
if (Get-WindowsCapability -Online | Where-Object -FilterScript { $_.Name -like '*VBSCRIPT*' }) {
try {
Expand Down
12 changes: 6 additions & 6 deletions Harden-Windows-Security.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1966,11 +1966,11 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
[parameter(Mandatory = $true, ParameterSetName = 'Capability')]
[System.String]$CapabilityName,
[parameter(Mandatory = $true, ParameterSetName = 'Feature')]
[System.String]$FeatureName,
[System.String]$FeatureName,
[parameter(Mandatory = $true, ParameterSetName = 'Feature')]
[ValidateSet('Enabling', 'Disabling')]
[System.String]$FeatureAction
)
)
switch ($Type) {
'Feature' {
if ($FeatureAction -eq 'Enabling') {
Expand All @@ -1991,7 +1991,7 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
Disable-WindowsOptionalFeature -Online -FeatureName $FeatureName -NoRestart -ErrorAction Stop
}
# Shows the successful message only if the process was successful
Write-Host -Object "$FeatureName was successfully $ActionOutput" -ForegroundColor Green
Write-Host -Object "$FeatureName was successfully $ActionOutput" -ForegroundColor Green
}
catch {
# show errors in non-terminating way
Expand All @@ -2006,7 +2006,7 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
'Capability' {
Write-Host -Object "`nRemoving $CapabilityName" -ForegroundColor Yellow
if ((Get-WindowsCapability -Online | Where-Object -FilterScript { $_.Name -like "*$CapabilityName*" }).state -ne 'NotPresent') {
try {
try {
Get-WindowsCapability -Online | Where-Object -FilterScript { $_.Name -like "*$CapabilityName*" } | Remove-WindowsCapability -Online -ErrorAction Stop
# Shows the successful message only if the process was successful
Write-Host -Object "$CapabilityName was successfully removed." -ForegroundColor Green
Expand All @@ -2020,7 +2020,7 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
Write-Host -Object "$CapabilityName is already removed." -ForegroundColor Green
}
break
}
}
}
}
Edit-Addons -Type Feature -FeatureAction Disabling -FeatureName 'MicrosoftWindowsPowerShellV2'
Expand All @@ -2038,7 +2038,7 @@ IMPORTANT: Make sure to keep it in a safe place, e.g., in OneDrive's Personal Va
Edit-Addons -Type Capability -CapabilityName 'Microsoft.Windows.WordPad'
Edit-Addons -Type Capability -CapabilityName 'Microsoft.Windows.PowerShell.ISE'
Edit-Addons -Type Capability -CapabilityName 'App.StepsRecorder'

# Uninstall VBScript that is now uninstallable as an optional features since Windows 11 insider Dev build 25309 - Won't do anything in other builds
if (Get-WindowsCapability -Online | Where-Object -FilterScript { $_.Name -like '*VBSCRIPT*' }) {
try {
Expand Down

0 comments on commit 561ef3e

Please sign in to comment.