I'm trying to use the receive-msmqueue cmd-let and have some problems doing so. The problem is what formatter I should use to get it to work. I see no examples so I don't really know what to enter as parameter
I'm trying to run the command as written below:
Receive-MSMQueue -Formatter 'System.Messaging.XmlMessageFormatter' -Path '<mypath>'
I get the following error when I run the command above:
Receive-MSMQueue : Cannot find a formatter capable of reading this message.At line:1 char:17+ Receive-MSMQueue <<<< -Formatter 'System.Messaging.XmlMessageFormatter' -Path 'formatname:direct=os:hs-w0531\private$\test1'
+ CategoryInfo : ReadError: (:) [Receive-MSMQueue], InvalidOperationException + FullyQualifiedErrorId : ReceiveFailed,Pscx.Commands.Messaging.ReceiveMSMQueue
The message on top in the queue gets removed when I run this so the queuename is Ok I guess.
What I really want is to automatically save all messages in a queue and remove them from the queue so that I later can restore them into the queue i the right order.
I figured I could read them with Receive-MSMQueue, store the messages in a file and then later read them and put them back(in the right order of course).
Am I way out of line or how should I get this going?