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