I would like to be able to start scripts on my network share without specifying the full path.
For example myscript.ps1 would run \\myserver\share\folder\folder2\myscript.ps1
I tried to add $env:Path += ";\\myserver\share\folder\" to my profile.ps1 but that didn’t work (I’ve confirmed that my profile.ps1 has been loaded).
What am I doing wrong? And am I even on the right path (pun intended..)?
Is possible to add
UNC pathin$env:pathin the way you have done.But in your example you add
but you’re trying execute a ps1 in
that’s why doesn’t work!
You need to add the full path where your ps1 file is!
Path values aren’t recursive.