Weekend Scripter: Parse NetStat with PowerShell 5—The Video


Summary: Ed Wilson, Microsoft Scripting Guy, shares a video he made that illustrates parsing NetStat with Windows PowerShell 5.0.

Microsoft Scripting Guy, Ed Wilson, is here. For someone who loves working at the command line, the new ConvertFrom-String cmdlet is awesome. I mean, I can do things in a single line of code that in the past, took 15 or 20 lines of code. This means less scripting and more production work.

Today, I am presenting a video to illustrate parsing the output of the NetStat command via Windows PowerShell, but this is simply the surface of how powerful this technique is.

[View:https://www.youtube.com/watch?v=FEiCb0o1_KU&feature=youtu.be:550:0]

Here is a link to the video from YouTube if you would like to download it or play it offline in a different video player: Parse NetStat info with PowerShell 5 by Ed Wilson).

Note  For more information about the technique of converting output from NetStat into an object and parsing it with Windows PowerShell, see Parsing NetStat Information with PowerShell 5.

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.

Ed Wilson, Microsoft Scripting Guy

Comments (2)

  1. jrv says:

    This is a convenient pattern for extracting objects:

    (arp -a)[3..999]|ConvertFrom-String -PropertyNames Blank,InternetAddress,MACAddress,Type,Blank2|select * -ExcludeProperty Blank*

  2. jrv says:

    In case anyone is interested here is the background on the extraction engine used by
    ConvertFrom-String

    http://research.microsoft.com/en-us/um/people/sumitg/pubs/pldi14-flashextract.pdf

Skip to main content