Receive-MsmqQueue -Peek throws a terminating error if queue is empty - by Keith Hill MVP

Status : 


Sign in
to vote
ID 775473 Comments
Status Active Workarounds
Type Bug Repros 1
Opened 12/30/2012 2:24:10 PM
Access Restriction Public


When testing if a queue has a message or is empty, I don't expect the "Peek" method to throw a terminating error to indicate the queue is empty. It would be much nicer to return either the first message or $null if the queue is empty.  At the very least, write a non-terminating error instead of throwing a terminating error so I still get back a $null from the operation.
Sign in to post a comment.