停止-计算机突然无法工作

停止-计算机突然无法工作

powershell stop-computercmdlet 突然停止工作,即使在管理员 shell 中也是如此:

PS C:\> Stop-Computer
Stop-Computer : Privilege not held.
At line:1 char:1
+ Stop-Computer
+ ~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (fluter-s:String) [Stop-Computer], ManagementException
+ FullyQualifiedErrorId : StopComputerException,Microsoft.PowerShell.Commands.StopComputerCommand

它以前在非管理员 shell 下工作,因为普通用户当然可以关闭系统。也没有系统更新。

版本信息:

PS C:\> echo $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14393.1066
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.1066
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

答案1

这一定是操作系统更新中出现错误所致。查看更多:https://support.microsoft.com/en-us/help/4020459/after-you-apply-april-2017-security-updates-from-cve-2017-0160

来自网站:
解决方法

要解决此问题,请运行以下“shutdown.exe”命令在本地或远程系统上执行关机和重启操作:

shutdown.exe [-r] [-s] [-m \\computer]

要了解更多信息和命令帮助,请运行:

shutdown.exe -?

相关内容