powershell get directory of ps1 file code example
Example: powershell script path
# Powershel 3+
$PSScriptRoot
# Powershell 2-
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
# Powershel 3+
$PSScriptRoot
# Powershell 2-
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition