Skip to content

Instantly share code, notes, and snippets.

@vijayjt
Last active May 21, 2017 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijayjt/17aab662d19a8fe0a855f44eaf048cbd to your computer and use it in GitHub Desktop.
Save vijayjt/17aab662d19a8fe0a855f44eaf048cbd to your computer and use it in GitHub Desktop.
Return the regions in the Azure Public IP XML file
Function Get-AzurePubicIpXMLRegionList
{
<#
.SYNOPSIS
The function takes the Azure Public IP address XML file and returns an array of region names
.DESCRIPTION
The function takes the Azure Public IP address XML file and returns an array of region names
.PARAMETER AzureIPRangeXMLFile
The XML file containing the Azure IP ranges.
.EXAMPLE
Get-AzurePubicIpXMLRegionList -AzureIPRangeXMLFile C:\AzurePublicIPs.xml
#>
[CmdletBinding()]
[OutputType([object[]])]
Param(
[Parameter(Mandatory=$true,HelpMessage='Enter the path to the Azure IP ranges XML file.')]
[String]$AzureIPRangeXMLFile
)
$AzureIPRanges = [xml] (Get-Content $AzureIPRangeXMLFile)
return $AzureIPRanges.AzurePublicIpAddresses.Region.Name
}#EndFuncion Function Get-AzurePubicIpXMLRegionList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment