【发布时间】:2016-02-23 04:30:55
【问题描述】:
我找到了这篇文章 Purge MSMQ queue and reset IIS from a bat file
清除私有 MSMQ 队列。我以为我可以通过将Private 更改为Public 来调整它以清除公共队列,但它失败了。
如何在 Powershell 2.0 中清除公共 MSMQ 队列?
谢谢!
【问题讨论】:
标签: powershell powershell-2.0 msmq
我找到了这篇文章 Purge MSMQ queue and reset IIS from a bat file
清除私有 MSMQ 队列。我以为我可以通过将Private 更改为Public 来调整它以清除公共队列,但它失败了。
如何在 Powershell 2.0 中清除公共 MSMQ 队列?
谢谢!
【问题讨论】:
标签: powershell powershell-2.0 msmq
知道了,我必须删除 private$ 而不是更改它。
这样就可以了:
[Reflection.Assembly]::LoadWithPartialName("System.Messaging")
$queueName = '.\testQueue'
$queue = new-object -TypeName System.Messaging.MessageQueue -ArgumentList $queueName
$queue.Purge()
【讨论】: