MyITGuy
3/28/2014 - 11:16 PM

PowerShell: Current Script Directory

PowerShell: Current Script Directory

Split-Path $MyInvocation.MyCommand.Path

Within a function

Split-Path $Script:MyInvocation.MyCommand.Path

$PSScriptRoot

if (!$PSScriptRoot) {$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path}