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

 

 $ips = 1..254 | % {"10.10.10.$_"} 

 

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: