2

I am running a pipeline job on a Windows VM, with default executor as shell. In this job, I wish to run a powershell script, which is located in a directory called CICD, by the following lines:

- powershell .\CICD\build_script.ps1 x86 $PROJECT_PATH
- .\CICD\build_script.ps1 x86 $PROJECT_PATH
- '.\CICD\build_script.ps1 x86 $PROJECT_PATH'

The script has 2 arguments: x86 and $PROJECT_PATH. Everytime I try to run one of these commands, I get this error:

.\CICD\build_script.ps1 : The term '.\CICD\build_script.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
+ .\CICD\build_script.ps1 x86 C:\GitLab-Runner\builds\BRmNra1o\0\mihnea ...
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.\CICD\build_script.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Is there a proper way to run this script?

1 Answer 1

1

You need a / instead of a \:

- cd CICD
- ./build_script.ps1 x86 $PROJECT_PATH
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.