Commands / System

Restart-Computer

Restart the computer

beginner System

Restart-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

ShellWhat you might type
bash / zshsudo reboot
cmd.exeshutdown /r /t 0

More in From bash and From cmd.

Related commands