Skip to content

Commit

Permalink
fix(Toggle Defender): disabling Defender
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Aug 6, 2023
1 parent 3c49544 commit 81ae46f
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,13 @@ function UninstallPackage {
param (
[switch]$Disable
)

if ($(CheckIfPackageIsInstalled) -ne 1) {
foreach ($package in $packages) {
try {
Remove-WindowsPackage -Online -PackageName $package -NoRestart -LogLevel 1 *>$null
} catch {
Write-Host "Something went wrong removing the package: $package" -ForegroundColor Red
Write-Host "$_`n" -ForegroundColor Red
if (!($Silent)) {PauseNul}; exit 1
}
foreach ($package in $packages) {
try {
Remove-WindowsPackage -Online -PackageName $package -NoRestart -LogLevel 1 *>$null
} catch {
Write-Host "Something went wrong removing the package: $package" -ForegroundColor Red
Write-Host "$_`n" -ForegroundColor Red
if (!($Silent)) {PauseNul}; exit 1
}
}
}
Expand Down

0 comments on commit 81ae46f

Please sign in to comment.