Reboot powershell prompt

$ButtonType = 4+16
$Timeout = 600
$Confirmation = New-Object -ComObject wscript.shell
$ConfirmationAnswer = $Confirmation.popup(“Would you like to immediately reboot your machine? Please save any work before clicking yes”,$Timeout,”Reboot prompt”,$ButtonType)
If ($ConfirmationAnswer -eq 6) {
$Confirmation.popup(“Click OK to reboot immediately”)
#shutdown /r /f /t 0
} else {
$Confirmation.popup(“Restart aborted.”)
}

Leave a Reply