Since April 2017 security updates, you may get the following error when you use the Stop-Computer cmdlet:
PS > Stop-Computer -ComputerName . -Force Stop-Computer : Privilege not held. At line:1 char:1 + Stop-Computer -ComputerName . -Force + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (COMPUTERNAME:String) [Stop-Computer], ManagementException + FullyQualifiedErrorId : StopComputerException,Microsoft.PowerShell.Commands.StopComputerCommand
As described by Microsoft in the following KB, it is an issue caused by the April 2017 security updates and affects PowerShell 3.0 and later.
This error has not yet been fixed. So you must use the Shutdown command as a workaround:
PS > shutdown.exe -r or PS > shutdown.exe -t
You also can still use the Stop-Computer cmdlet by adding the -AsJob parameter:
PS > Stop-Computer -AsJob
Thanks for reading! You can follow me on Twitter @PrigentNico