Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Restart or Shut Down Your Computer Using PowerShell

October 22, 2022
in Blog, Powershell
0
ADVERTISEMENT

Table of Contents

Typically, most of us turn off our Windows computers using Start > Power, but by using PowerShell, many more options are available to you.

Using the command line, we can schedule a shutdown or restart, make notes, go to advanced boot options, do a full shutdown, shut down or restart a remote computer, and more.

Open the Windows PowerShell

Right click on the Windows Start icon then select Windows PowerShell. In Windows 11, select Terminal or Windows Terminal.

Pw1

The command you need to know is shutdown followed by a command or argument. Go ahead and type in shutdown now to see a list of available commands.

Bg2164

Restart or Shut Down your computer using PowerShell

1. Restart your computer using the following PowerShell command.

shutdown /r
Note Make sure you save all your work and close all open programs. You have one minute before the actions.
Bg2168

2. Shut down or turn off your computer using PowerShell.

shutdown /s

Optionally, if you want to try it out now, type in a shutdown command, close the one-minute warning window, and type in . A window will popup letting you know that it was canceled.

shutdown /a
Bg2167
ADVERTISEMENT

Schedule shut down or restart computer using PowerShell

You can set the time-out period before shutdown to xxx seconds using switch. The valid range is 0-315360000 (10 years), with a default of 30. The below command will shut down in 10 minutes.

shutdown /r /t 600
Bg2169

Immediate restart with no countdown

If you want to immediately restart with no countdown or message, use this command:

shutdown /r /t 0

Go to the advanced boot options menu

You can use the switch to go to the advanced boot options menu and restart the computer. Must be used with /r option.
shutdown /r /o /t 5
Bg2170
ADVERTISEMENT

Reference commands

Here is the list of available commands for your reference:

  • /? – Display help.
  • /i – Display the graphical user interface (GUI).
  • /l – Log off. This cannot be used with /m or /d options.
  • /s – Shutdown the computer.
  • /sg – Shutdown the computer. On the next boot, if Automatic Restart Sign-On is enabled, automatically sign in and lock the last interactive user. After sign in, restart any registered applications.
  • /r – Full shutdown and restart the computer.
  • /g – Full shutdown and restart the computer. After the system is rebooted, if Automatic Restart Sign-On is enabled, automatically sign in and lock the last interactive user. After sign in, restart any registered applications.
  • /a – Abort a system shutdown. This can only be used during the time-out period. Combine with /fw to clear any pending boots to the firmware.
  • /p – Turn off the local computer with no time-out or warning. It can be used with /d and /f options.
  • /h – Hibernate the local computer. It can be used with the /f option.
  • /hybrid – Performs a shutdown of the computer and prepares it for a fast startup. Must be used with /s option.
  • /fw – Combine with a shutdown option to cause the next boot to go to the firmware user interface.
  • /e – Document the reason for an unexpected shutdown of a computer.
  • /o – Go to the advanced boot options menu and restart the computer. Must be used with /r option.
  • /m computer – Specify the target computer
  • /t xxx – Set the time-out period before shutdown to xxx seconds. The valid range is 0-315360000 (10 years), with a default of 30. If the time-out period is greater than 0, the /f parameter is implied.
  • /c – “comment” Comment on the reason for the restart or shutdown. A maximum of 512 characters allowed.
  • /f – Force running applications to close without forewarning users. The /f parameter is implied when a value greater than 0 is specified for the /t parameter.
  • /d [p|u]xx:yy – Provide the reason for the restart or shutdown. Here are the command explanations:
  • p – indicates that the restart or shutdown is planned.
  • u – indicates that the reason is user-defined. If neither p or u is specified, the restart or shutdown is unplanned.
  • xx – is the major reason number (positive integer less than 256).
  • yy – is the minor reason number (positive integer less than 65536).
5/5 - (1 vote)
Previous Post

How to Add a Timeout or Delay in a PowerShell Script

Next Post

How to Restart or Shut Down Your Computer Using CMD

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory