MSMQ Cmdlets

Topics: Developer Forum, Project Management Forum, User Forum
Oct 3, 2009 at 9:40 PM

Hi guys,

I am pretty new to MSMQ and Powershell. Can somone help with a problem?

I want to read a MSMQ messages from a MSMQ queue in a orderly manner. The messages body is defined by an xsd and it is put on the queue by Biztalk. The information in the XML document will I use in the powershell script. I tried to use the Recieve-MSMQMessage command but I only manage to read messages with targetype String.

Is there any good source for example code for using the PowerShell Community Extension - and in particular MSMQ cmdlets.


Regards Dag

Oct 4, 2009 at 12:27 AM

You have two options:

1) read as string, cast to [xml], use the untyped xml
2) generate XML serialization types from the schema using xsd.exe (part of Windows & .NET SDK), load the resulting assembly, and use the root type as the -TargetType