Saturday, 8 March 2014

PS Script will not run from current directory

Your PowerShell script will not run from the current folder.

If you have myscript.ps1 in c:\myfolder and your current directory is c:\myfolder you will find your script will not run.  PowerShell does not search the current folder only those included in the Path variable.

Include the full path c:\myfolder\myscript.ps1 or .\myscript.ps1

the other alternative is to add you folder to the path variable.

No comments:

Post a Comment