代码之家  ›  专栏  ›  技术社区  ›  Murilo Faria

Powershell术语“Get-MsmqQueue”在Windows Server 2008 R2 SP1中未被识别为cmdlet的名称

  •  0
  • Murilo Faria  · 技术社区  · 7 年前

    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,什么都没有。

    我怎么解决这个问题?

    1 回复  |  直到 7 年前
        1
  •  1
  •   Persistent13    7 年前

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

    您可以通过使用WMI来拉取MSMQ数据来解决这个问题,但我不知道如何做的细节。这个答案 here 显示了一个示例。