I'm wondering if its possible to write a Powershell script to move a message from one MSMQ queue to another?
I have a few failed messages (i.e. messages that did not complete because they involved, say, a call to a server that was down, for example) in an error queue that I would like to retry by moving them back into their original processing queue. I am using NServiceBus v6 handlers to listen for messages that enter the original processing queue that will resend the message if they are put back into that queue.
Has anyone done this before using Powershell?
In particular, I would like to do the following in Powershell:
- Find a message based on a specific identifier (string) within the message body
- Move this message to a specific queue
I know Powershell has commands such as Move-MsmqMessage. I have been unable to find an example online that I can re-use for this function.
Any help much appreciated.