-1

I want to retrieve each IP address of the on its own, because when I run the following Cmdlet:

$web =  (Get-AzureRmWebApp -Name forthesakeoftest).OutboundIpAddresses

I get the following result: 104.40.191.174,23.100.3.112,23.97.216.155,23.97.186.126,23.97.184.187 Where all the Ips are in the same line. How can I retrieve each one of them separately?

Mohamed Wali
  • 185
  • 10

2 Answers2

1

This seems to work for your case. not exactly a beatiful solution, but it gets the job done.

$web =  (Get-AzureRmWebApp -Name forthesakeoftest).OutboundIpAddresses
$formattedWeb = $web.Split("{,}")
Paxz
  • 2,959
  • 1
  • 20
  • 34
Antti P
  • 344
  • 1
  • 7
0

(Get-AzureRmWebApp -Name "whatever name").OutboundIpAddresses.Split(",")

Will give you an array of IP addresses that you can then process.

CodeDNA
  • 1
  • 3