Forum Discussion

Kilimanjaro's avatar
Kilimanjaro
Copper Contributor
Jul 17, 2020

Get all messages with info from queue with powershell

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

  • HusseinAwad's avatar
    HusseinAwad
    Copper Contributor
    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!