Showing posts with label ToolMaking. Show all posts
Showing posts with label ToolMaking. Show all posts

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).


2013/10/11

PowerShell Studio 2012 - WinForms - GUI ToolMaking

In my previous post I showed how to create a quick PowerShell GUI to append some colored text in a RichTextBox control using Sapien PowerShell Studio 2012.

Today I will go a bit further and show you how to create a tool to query some information from a remote computer. I will first send the Output to Out-GridView cmdlet and then show you how to send it to a DataGridView control inside the GUI.

The tool will query Services, Processes and Shares from a Remote Computer.
You will need to specify the ComputerName and the Credential required to perform those actions. The goal is to show how to create something very simple so I did not write any Error Handling or any conditional code in this version.

One cool thing to mention when using PowerShell Studio 2012 is, if you add some controls like a DataGridView, a Listview or a ListBox, PowerShell Studio 2012 will add some functions to help you Load/Add/Refresh those controls. I will show you below in the part "Replacing the Out-Gridview by a DataGridView Control"