Author Archives: Steve Renard

About Steve Renard

Steve Renard is a French IT Consultant working in Switzerland. He is a 100% Powershell passionate always looking for automate tasks to save more time and to be more productive in his day-to-day work. He is working on a project to build a complete and centralized FAQ (link on twitter) to contribute to the Powershell community and writes some articles related to best practices and optimization techniques for Powershell.

Powershell Tip #134: Out-GridView with PassThru parameter

Tip: You can use the PassThru parameter to send the selected items from the window down the pipeline with the Out-GridView cmdlet.

In other words, with the PassThru parameter the GUI window will get two buttons : OK and Cancel.

Without -PassThru

With -PassThru

If you select the calc.exe line and press Ctrl key to select also mspaint.exe, when you click OK both processes will be stopped.

The parameter -PassThru can be useful to select multiple items and perform on action on them.


Powershell Tip #133: Set a title to Out-GridView window

Tip: You can set a title when using the Out-GridView cmdlet.
It can be useful in cases you have multiples windows open to compare them.


Powershell Tip #131: Add certificates to Personal, Root and Intermediate stores

Tip: You can add certificates to Personal, Root and Intermediate stores (LocalMachine)








StoreLocation Enumeration
StoreName Enumeration


Powershell Tip #130: Convert ticks <> datetime

Tip: You can convert tickets to datetime and vice versa.

Convert ticks to datetime

Convert datetime to ticks


Powershell Tip #129: Get midnight time

Tip: You can get the midnight time :


Powershell Tip #127: Wait for EMC Avamar Backup to be completed

Tip: You need to wait until the EMC Avamar Backup client finishes the backup.


An easy way to do that is to check if the processes avtar and avvss are running.


Powershell Tip #125: Identify the duplicates headers of a CSV file

Tip: You can identify the headers duplicated in a CSV file.

It can happen if someone save as CSV an Excel file and some duplicates were repeated multiple times by mistake.


When trying to import the CSV, we can only see the first duplicate found but not all of them (SamAccountName and Department).


Here we can see the two duplicates headers :