Author: Mike Swanson Machine: DESKTOP-0O8A1RL Timestamp: 2026-05-15 15:23:02
13 lines
563 B
PowerShell
13 lines
563 B
PowerShell
$result = Uninstall-WindowsFeature -Name Windows-Defender -ErrorAction SilentlyContinue
|
|
Write-Host "Success: $($result.Success)"
|
|
Write-Host "RestartNeeded: $($result.RestartNeeded)"
|
|
Write-Host "ExitCode: $($result.ExitCode)"
|
|
if ($result.Success) {
|
|
shutdown /r /t 10 /f
|
|
Write-Host "Rebooting in 10s..."
|
|
} else {
|
|
Write-Host "Feature removal failed - trying registry approach"
|
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Defender\Features" -Name "TamperProtection" -Value 4
|
|
Write-Host "TamperProtection set to 4 - reboot required"
|
|
}
|