Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

".\SomePSScript.ps1" does not run it acts like the .\ was not present.

$
0
0

We use some power shell script in our development process that are not working on 1 of 4 peoples computer... we use a dos batch command line to kick off powershell.exe the command we are running is:

powershell.exe .\source\startpipeline.ps1 -pathToEnvironment "environments\phillipg"

The error it gives us is:

.\source\startpipeline.ps1 : The term '.\source\startpipeline.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ .\source\startpipeline.ps1 -pathToEnvironment environments\phillipg
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (.\source\startpipeline.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Any ideas, we did check / validate that the powershell version was the same on a box where the command works, and a box where it does not.

PS C:\Users\dwijewickrema> $psversiontable

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.18052
BuildVersion                   6.2.9200.16398
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2

We also verified that putting the fully qualified path fixes the issue, but is not a long term solution for us, as we dont want to be tied to a directory structure / drive letter.

Thanks in advance... 

-Deva


Deva Wijewickrema


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>