【问题标题】:Purge a public MSMQ queue in Powershell 2.0在 Powershell 2.0 中清除公共 MSMQ 队列
【发布时间】: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


    【解决方案1】:

    知道了,我必须删除 private$ 而不是更改它。

    这样就可以了:

    [Reflection.Assembly]::LoadWithPartialName("System.Messaging")
    $queueName = '.\testQueue'
    $queue = new-object -TypeName System.Messaging.MessageQueue -ArgumentList $queueName
    $queue.Purge()
    

    【讨论】:

      猜你喜欢
      • 2013-07-01
      • 2011-09-23
      • 2011-03-24
      • 2010-12-06
      • 2011-06-16
      • 1970-01-01
      • 2018-02-02
      • 2012-08-01
      • 2016-08-10
      相关资源
      最近更新 更多