$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"
}
