Last active
April 15, 2020 14:38
-
-
Save juanesech/5081d0ebbaa71c1dbeffab9aadf327b0 to your computer and use it in GitHub Desktop.
Select a azure subscription that contains a string pattern in his name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$subsNames = @(Get-AzSubscription | select name) | |
foreach ($name in $subsNames) { | |
if ($name -match "USWE") { | |
Get-AzSubscription -SubscriptionName $name | Set-AzContext | |
#Commands to run into subscription | |
Get-AzResourceGroup | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment