Get all messages with info from queue with powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-1529806%22%20slang%3D%22en-US%22%3EGet%20all%20messages%20with%20info%20from%20queue%20with%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1529806%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20question%20-%20is%20there%20some%20possibility%20of%20taking%20all%20messages%20from%20the%20service%20bus%20queue%20with%20all%20information%20like%20content%20and%20headers%20with%20PowerShell%3F%3CBR%20%2F%3ETo%20take%20one%20I%20use%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24postService%20%3D%20Invoke-WebRequest%20-Uri%20%22https%3A%2F%2Fmyservice.servicebus.windows.net%2Ftest%2Fmessages%2Fhead%22%20%20-Headers%20%24header%20-Method%20Post%20%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20I%20need%20all%20list%2C%20and%20unfortunately%2C%20I%20do%20not%20find%20a%20way%20to%20do%20it%20with%20PS%2C%20but%20only%20with%20C%23%20%3D%2F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

My question - is there some possibility of taking all messages from the service bus queue with all information like content and headers with PowerShell?
To take one I use 

$postService = Invoke-WebRequest -Uri "https://myservice.servicebus.windows.net/test/messages/head"  -Headers $header -Method Post 

 

But I need all list, and unfortunately, I do not find a way to do it with PS, but only with C# =/

1 Reply
Yes you can. You just need to be careful what action you want to do, wether you want to read the messages ad delete them from thr queue. Or you want to read the messages and leave them at the original queue as it is. Hope this helps!