I’ve been extended and upgrading my library of network functions for some time now, I thought I’d post the functions that work directly with my original collection.

The functions described here have been updated since posting this article. The updated functions are available as part of the script module Indented.NetworkTools.

ConvertTo-HexIP

Sometimes being able to convert to a hexadecimal format is useful, this little function does exactly that. The body is very simple; it uses the built in formatters.

ConvertFrom-HexIP

And back again, using System.Convert.ToUInt32 with a base-16 value to get to UInt32, then a call to ConvertTo-DottedDecimalIP (from the original set).

Get-NetworkSummary

Get-NetworkSummary gets a bit of an improvement.

Get-NetworkRange

And so does Get-NetworkRange.

Get-Subnets

I ran into a need to calculate a list of subnets of a specific length within a super-net, this function does just that.

m4s0n501

1 Comment

  1. I really like your sub-net math functions – the original collection and the additions. Much appreciated.

    In order to use them on one of the projects that I am working on a clear licence statement would be very helpful. You did mention on the VbScript version post in the comments that all code is intended to be public domain. In contrast to that your footer on every page clearly states “All rights reserved.”

    I also downloaded your NetShell module, and the copyright attribute doesn’t help to clarify either.

    Just trying to stay our of trouble ;-)

    Thanks again!

    Andy

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">