Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell术语';获取MsmqQueue';未被识别为Windows Server 2008 R2 SP1中cmdlet的名称_Windows_Powershell_Msmq - Fatal编程技术网

Powershell术语';获取MsmqQueue';未被识别为Windows Server 2008 R2 SP1中cmdlet的名称

Powershell术语';获取MsmqQueue';未被识别为Windows Server 2008 R2 SP1中cmdlet的名称,windows,powershell,msmq,Windows,Powershell,Msmq,我试图在Windows Server 2008 R2 SP1(x64)中使用命令Get-MsmqQueue,但出现以下错误: Get-MsmqQueue : The term 'Get-MsmqQueue' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,

我试图在Windows Server 2008 R2 SP1(x64)中使用命令Get-MsmqQueue,但出现以下错误:

Get-MsmqQueue : The term 'Get-MsmqQueue' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-MsmqQueue
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-MsmqQueue:String) [], Comma
   ndNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
MSMQ安装在机器上,Powershell版本为5,我已经重新安装了MSMQ,什么都没有


如何解决此问题?

虽然您已安装PowerShell版本5,但它不会包含任何新的cmdlet。原因是cmdlet与操作系统可用的API绑定,而2008 R2没有所需的API。您将无法使用cmdlet,因为它在server 2012中首次可用

您可以通过使用WMI来提取MSMQ数据来解决此问题,但我不知道如何具体操作。这个答案给出了一个例子