PowerShell hosting and $MyInvocation
Many PowerShell users utilize code as shown below to determine where the running script resides:
function get-scriptdirectory{ $invocation=(get-variable MyInvocation -Scope 1).Value Split-Path $invocation.myinvocation.path}
Unfortunately, if the script runs inside a custom host, such as PrimalScript’s internal host, for a good…
Read More