get location in ps1 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