Monthly Archive: March 2013

Mar 25

Powershell Tips of the week #3 – Find parent folder

How to find the parent folder of a path that is stored in a variable For the purpose of the example I will manually add a path to a variable. $VarA = "\\\dfs\files\dan.fortier\" The parent folder of this path is “\\\dfs\files” but lets find it with powershell using the Get-Item cmdlet. $ParentFolder = (Get-Item $VarA).parent.FullName …

Continue reading »

Mar 19

Powershell Tips of the week #2 – Measure-Command

In today’s post I will talk about the Measure-Command function in Powershell. This function will tell you exactly how much time it took to run a cmdlet or a script block. The result will be displayed like this: Days              : 0 Hours             : …

Continue reading »

Mar 14

Powershell Tips of the week #1 – Cmdlet Start-Transcript

This week I will show you how to use the Start-Transcript cmdlet. Start-Transcript will allow you to record your powershell session in a text file. The transcript includes all command that the user types and all output that appears on the console. Here is some example on how to use Start-Transcript: This command starts a …

Continue reading »