Created
April 14, 2020 22:23
-
-
Save marckean/4afca5217e4d3e1aa5b06a90547b1f4d to your computer and use it in GitHub Desktop.
This file contains 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
<# | |
Written with version 3.5.0 of the Azure PowerShell Module | |
available from here https://github.com/Azure/azure-powershell/releases/tag/v2.8.0-October2019 | |
Install-Module -Name Az -Repository PSGallery -RequiredVersion 3.5.0 -Force -AllowClobber | |
Migration instructions Azure.RM to Az - https://azure.microsoft.com/en-au/blog/how-to-migrate-from-azurerm-to-az-in-azure-powershell/ | |
#> | |
Login-AzAccount | Out-Null | |
$subscriptions = Get-AzSubscription | |
$cnt = 1 | |
Write-Host "ID Subscription Name" | |
Write-Host "-----------------------" | |
foreach ($sub in $subscriptions){ | |
Write-Host "$cnt $($sub.name)" | |
$cnt++ | |
} | |
$selection = Read-Host -Prompt "Select a subscription to deploy to" | |
$subSelect = $subscriptions[$selection - 1] # Revert 1-index to 0-index | |
Select-AzSubscription $subSelect.SubscriptionId | |
############################################################################# | |
$CommunityNames = (Get-AzBgpServiceCommunity).BgpCommunities.CommunityName | |
$cnt = 1 | |
foreach ($CommunityName in $CommunityNames){ | |
Write-Host "$cnt $CommunityName" | |
$cnt++ | |
} | |
$selection = Read-Host -Prompt "Select a Community Name to get the BGP communities" | |
$CommunityNameSelect = $CommunityNames[$selection - 1] # Revert 1-index to 0-index | |
Get-AzBgpServiceCommunity | ? {$_.BgpCommunities.CommunityName -eq $CommunityNameSelect} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment