Skip to content →

Working with IP Network Ranges in PowerShell

If you've never done it, you might think it could be a little bit complicated.  Not really, indeed:

PS C:\>10..251 | foreach { "192.168.200." + $_ } | format-list

Working with CDIR notation is not that straight forward. The best reference I've found about this subject can be found on this article: Finding a Range of IP addresses in CDIR notation. Brilliant!

License

Creative Commons License
Except where otherwise noted, ThinkInBig by Carlos Veira Lorenzo is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Published in Automation System Management