by david via t h e D a v i d A i k e n on 11/19/2008 10:37:00 PM
Sometimes you have messages in a queue, and you want to have a peek at them (or even read and remove them). The most obvious answer to this is to build a little utility that allows you to browse queues, peek messages etc. But did you already know the CloudDrive Windows PowerShell provider already lets you do it!
Here is how you can get at the queues.
You should now be in PowerShell, and be able to issue commands such as
dir blob:
and
dir queue:
you can even execute
cd blob:
and use dir etc. to navigate the blobs.
So now for the queue, my queue is called messages so executing
dir queue:\messagequeue
yields
as you can see i have a single message in the queue. To read the message, first I need a reference to a queue.
$q = (dir queue:\messagequeue)
I can now call get-member on the $q object and view a list of methods and properties available.
$q | get-member
Note we have all the methods available in the queue, including PeekMessage. To read that first message I can call
$q.PeekMessage()
Which gives:
Finally, I can view the contents of the message using
$q.PeekMessage().ContentAsString()
Which gives my message content.
Hopefully using this little starter, you will be able to figure out how to create and manipulate queues and messages.
THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS
Share this post :
Original Post: Peeking Windows Azure Queues using Windows PowerShell
The content of the postings is owned by the respective author. AzureFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on AzureFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.