I'm writing a PowerShell script to list Resource Groups across Azure Subscriptions.
Get-AzureRmSubscription |
select -ExpandProperty name |
% {
Get-AzureRmResourceGroup | select -ExpandProperty resourcegroupname
}
This code works. It returns results like this.
Resource group 1
Resource group 2
Resource group 3
How can I tweak the code to get the output like below?
Subscription 1,Resource group 1
Subscription 1,Resource group 2
Subscription 2,Resource group 3
Thank you so much.