Get-WMIObject 返回一个没有描述的错误 [英] Get-WMIObject returns an error without a description

查看:76
本文介绍了Get-WMIObject 返回一个没有描述的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的其中一台生产服务器上,我在运行脚本时开始出现错误.剥离代码,我在 PowerShell 提示符下运行此命令时收到错误:

On one of our production servers, I started to get an error while running our scripts. Stripping down the code, I receive the error when running this command from the PowerShell prompt:

Get-WmiObject -Class win32_volume

结果如下:

Get-WmiObject :
At line:1 char:14
+ Get-WmiObject <<<<  -Class win32_volume
    + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], COMException
    + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

对我来说值得注意的是,结果的第一行没有对错误的描述.这个脚本过去一直有效,并且继续在我们的其他服务器上工作.

What's noticable to me is that there's no description of the error on the first line of the result. This script has worked in the past, and continues to work on our other servers.

我在服务器上以管理员身份运行此程序,PowerShell 会话处于管理员模式.有关如何解决此问题的任何建议?

I'm running this as an administrator on the server, and the PowerShell session is in administrator mode. Any suggestions about what to do to solve this?

谢谢.

推荐答案

我们遇到了这个错误,WMI 崩溃了,但没有给出任何迹象表明它已经崩溃了 - 重新启动它解决了问题.

We had this error and WMI had crashed without giving any indications that it had done so- restarting it solved the problem.

这篇关于Get-WMIObject 返回一个没有描述的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆