3

I'm stuck in what seems to be a basic thing. I'm trying to run conan.exe which is located in C:\Program Files (x86)\Conan\conan\conan.exe. The errors I get are either

.\C:\Program Files (x86)\Conan\conan\conan.exe : The term '.\C:\Program Files (x86)\Conan\conan\conan.exe' 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
+ .\"C:\Program Files` (x86)\Conan\conan\conan.exe"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.\C:\Program Fi...conan\conan.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

or

x86 : The term 'x86' 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:22
+ .\C:\Program Files` (x86)\Conan\conan\conan.exe
+                      ~~~
    + CategoryInfo          : ObjectNotFound: (x86:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I've tried a combination of ", ', using ` for spaces, using & at the start (doesn't work since it's reserved for GitLab Runner). I'm out of ideas and my google searches don't seem to help specifically for gitlab ci/cd context.

This is the latest .gitlab-ci.yml I tried:

stages:
    - build
    - publish

test_build:
    stage: build
    script:
        - \& "C:\Program Files (x86)\Conan\conan\conan.exe"
    tags:
        - build

With this error:

At C:\WINDOWS\TEMP\build_script663599467\script.ps1:229 char:2
+ \& "C:\Program Files (x86)\Conan\conan\conan.exe"
+  ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double 
quotation marks ("&") to pass it as part of a string.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : AmpersandNotAllowed
 
Cleaning up file based variables
00:01
ERROR: Job failed: exit status 1

Anyone has any idea what could work?

2
  • 1
    Maybe try to use Start-Process instead of the ampersand. Commented Apr 13, 2021 at 16:19
  • 1
    I haven't tried this but I just got it to work with "& \"C:\\Program Files (x86)\\Conan\\conan\\conan.exe\"". Commented Apr 13, 2021 at 16:33

1 Answer 1

0

Here Is the answer. In short:

script:
    - 'powershell.exe D:\app\CiTest.exe'

While CiTest.exe is a dotnet framework 4.8 console application.

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.