Powershell:无法访问 MSMQ Cmdlet

Powershell: can't access MSMQ Cmdlets

我想使用消息队列 (MSMQ) Cmdlets Message Queueing (MSMQ) Cmdlets 但它们都显示为不可用:

PS C:\users\admin\Desktop> 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) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

我有 Windows 8.1 和 PowerShell 4 运行 作为管理员

PS C:\users\admin\Desktop> $PSVersionTable.PSVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1

根据 OP 的评论,未安装 MSMQ 功能:

I just assumed the machine I was on had MSMQ already but it turned out it didn't.

有关如何使用 PowerShell 安装它们的说明,请参阅 this question