![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | MSMQ Peek not working right I am trying to peek a message off of a queue and it works, but it doesn't. Here's the code i am using: [Reflection.Assembly]::LoadWithPartialName("System.Messaging") $queue = new-object System.Messaging.MessageQueue "FormatName IRECT=OS:servername\private$\test"$queue.Formatter.TargetTypes = ,"System.String" $peekmsg = $queue.Peek() $ts = new-object TimeSpan 30000000 $peekmsg = $queue.Peek($ts) Write-Host $peekmsg.Body If I have the following in the body...: <?xml version="1.0"?> <string>hello world</string> Then the "Write-Host $pkmsg.Body" outputs: hello world But if I have the following in the body...: <?xml version="1.0"?> <StandardDate> <Year>0</Year> <Month>11</Month> <DayOfWeek>0</DayOfWeek> <Day>1</Day> <Hour>2</Hour> <Minute>0</Minute> <Second>0</Second> <Millisecond>0</Millisecond> </StandardDate> Then the "Write-Host $pkmsg.Body" command outputs nothing. I have read all sorts hits about how to do this in C#, but I can't translate that into powershell-ese and apparently nobody in the universe is doing MSMQ with powershell. I'm still learning powershell, so I'm pretty much stuck. Any ideas or examples would be appreciated! Thanks, /drez |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: MSMQ Peek not working right | Oisin (x0n) Grehan [MVP] | PowerShell | 0 | 02-28-2008 05:07 PM |
| [MSMQ]Shell for basic opeartions with MSMQ ? | Oriane | PowerShell | 4 | 09-25-2007 05:11 AM |
| Vista/MSMQ question | ESmith | Vista General | 6 | 08-27-2007 05:58 PM |
| New Windows Live Mail sneak peek | Gary VanderMolen | Vista mail | 1 | 05-27-2007 08:24 PM |
| MSMQ Usage in PS | Andrew Burns | PowerShell | 2 | 11-02-2006 06:43 PM |