Generating a list of IP Addresses

Quite often, for one reason or another, I need to create a list of IP Addresses. The Powershell Range Operator ".." comes in handy for such a situation. To get a list of all the IP's in 10.10.10.0/24 I can run the following command

 

[sourcecode language='css'] $ips = 1..254 | % {"10.10.10.$_"} [/sourcecode]

 

Now I have an array of my IP's that I can work with

Comments are closed