Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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