I had a similar problem: the scripts with my points did not execute when I ran the main script and run as administrator.
It turned out that the underlying dir was different when I ran the script as an administrator. Try to use the absolute path in the search for points. If it works, you can find a better solution, for example:
$subScriptName = "MySubscript.ps1" $subScriptPath = Join-Path -Path $callingDir -ChildPath $subScriptName if (Test-Path $subScriptPath) {
Hinek source share