Showing posts with label netstat. Show all posts
Showing posts with label netstat. Show all posts

2014/09/06

PowerShell - ConvertFrom-String and the TemplateFile parameter

I'm continuing to play with the new ConvertFrom-String cmdlet (available in the last WMF 5.0 September preview released yesterday) which make the parsing job really easy for simple or complex output.

This cmdlets supports two types of modes: Basic Delimited Parsing (See yesterday's post) and the Auto-Generated Example-Driven Parsing which I will cover in this post.

This Auto-Generated Example-Driven Parsing mode is based on the FlashExtract research work in Microsoft Research...

Important: This post is based on the September 2014 preview release of WMF 5.0. This is pre-release software, so this information may change.

2014/09/05

PowerShell - Playing with the new ConvertFrom-String cmdlet

In a previous post I talked about parsing NetStat.exe using PowerShell and some regex, It is a fun exercice but require some knowledge to figure out how the parsing should happen.

Today, It got way easier !! The PowerShell Team just released a new version of the WMF : v5 September preview ! And One of the coolest feature is the new ConvertFrom-String cmdlet.

EDIT (2014/10/02): See also my post about using ConvertFrom-String and the param -TemplateFile against Netstat.exe

Using the same example from my previous post, I will perform a simple parsing of netstat.exe -n and send the output to ConvertFrom-String.

Important: This post is based on the September 2014 preview release of WMF 5.0. This is pre-release software, so this information may change.

2014/08/17

PowerShell - Parse this: NetStat.exe

In the last couple of months I had to parse different types of output using PowerShell and I thought it would be a cool idea to explain how this can be done. Command line tool: Netstat.exe

This small tool allows you to display active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 and IPv6 statistics.

In this example I will use the parameter '-n' which displays active TCP connections (without name resolution).