Purge a public MSMQ queue in Powershell 2.0 Purge a public MSMQ queue in Powershell 2.0 powershell powershell

Purge a public MSMQ queue in Powershell 2.0


Got it, I had to remove private$ instead of changing it.

So this does the job :

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