How to power off a computer (or a list of) with one powershell command
Let’s say you need to execute a long script but needs to power off the computer after the execution. You can end the script with:
If you want to try the command but without it actually executing, try with the -WhatIf parameter! It will show what would be executed without actually doing it!
The command let’s you power off multiple systems as well, just name them on the command. If you are going to try this at your works network, please use it with the -WhatIf parameter!
Stop-computer -ComputerName ‘computer01′,’computer02′,’computer03’