Restart-Computer
Restart the computer
Restart-Computer -WhatIf
- Works on
- Windows
- PowerShell
- 5.1 and later
- Reference
- Microsoft Learn: Restart-Computer
Careful: Restarts immediately with no countdown. Save your work first.
Restarts the computer straight away. -WhatIf shows what would happen without restarting.
-Force restarts even if programs have unsaved work. Avoid it on your own machine.
To shut down instead, use Stop-Computer.
Try this
Restart in 5 minutes, with a warning to anyone signed in:
shutdown.exe /r /t 300 /c "Restarting for updates in 5 minutes"
Changed your mind? shutdown.exe /a cancels it.
Coming from another shell
| Shell | What you might type |
|---|---|
| bash / zsh | sudo reboot |
| cmd.exe | shutdown /r /t 0 |
More in From bash and From cmd.