Powershell Grid-View

get-service | where {$_.name -match "win"}

Normally displays like this:
Powershell_ouptut_normal

Note how very long names can get cut off with the ellipses….

Did you know that Powershell has a “grid-view”, similar to SQL?

get-service | where {$_.name -match "win"} | out-gridview

Powershell_output_gridview

If you pipe all get-service to the out-gridview, then you can see how you can even filter the data using the “GUI” mode.
Click “Add Crtieria”, then click the checkbox next the desired property name.
Powershell_output_gridview_AddCriteria

 

You can then enter a match/contains value for that property, and the grid instantly changes to show only the matching data:

Powershell_output_gridview_NameContains

Instead of filtering with the “contains” clause, you can click the word “contains”, and choose other methods of filtering.

I was truly amazed when I discovered this feature.

Powershell_output_gridview_Filter_Options

 

Uncategorized  

Leave a Reply