Home Dashboard Directory Help
Search

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


Status: 

Active


4
0
Sign in
to vote
Type: Bug
ID: 775473
Opened: 12/30/2012 2:24:10 PM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

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.
Details
Sign in to post a comment.
Sign in to post a workaround.