Powershell Tip #138: Determine the location of the current script By powershellgu | November 18, 2018 0 Comment Tip: You determine the location of the current script. PowerShell # PowerShell 3+ $PSScriptRoot # PowerShell 2 Split-Path -Parent $MyInvocation.MyCommand.Definition 12345 # PowerShell 3+$PSScriptRoot # PowerShell 2Split-Path -Parent $MyInvocation.MyCommand.Definition