What’s the best way to determine the location of the current PowerShell script?
Whenever I need to reference a common module or script, I like to use paths relative to the current script file. That way, my script can always find other scripts in the library. So, what is the best, standard way of determining the directory of the current script? Currently, I’m doing: $MyDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition) I … Read more