Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
21 views
in PowerShell by 4 6 10
I have a PowerShell script that requiers to shutdown or Power off my computer once the script finish, How I turn off my comupter using Windows PowerShell?

1 Answer

1 like 0 dislike
by 56 122 250
selected ago by
 
Best answer

How to Stop the local computer using PowerShell?

You can use Stop-Computer cmdlet to shut down the local computer as the following:

Example 1:

Stop-Computer

Example 2:

Stop-Computer -ComputerName localhost

How to Stop the remote computer using PowerShell?

You can use Stop-Computer cmdlet to shut down remote computers as the following:

Example 1:

Stop-Computer -ComputerName "Server01", "Server02"

How to Stop the local and remote computer using PowerShell?

You can use Stop-Computer cmdlet to shut down the local and remote computers as the following:

Example 1:

Stop-Computer -ComputerName "Server01", "Server02",localhost

See More examples at Stop-Computer

If you don’t ask, the answer is always NO!
...