I am trying to run powershell command. I have set up 2 variables:
$env:P7_TESTING_INSTALLATION_PATH = "D:\Logos_block_gitlab_runner\pSeven-v2024.05"
$env:CI_PROJECT_DIR = "D:\Logos_block_gitlab_runner\GitLab-Runner\builds\vDLVWCgmH\0\aero\logos_userblock"
Then I am trying to run command using these variables:
Invoke-Command -ScriptBlock {$env:P7_TESTING_INSTALLATION_PATH\client\p7batch.exe --log-level=error --run $env:CI_PROJECT_DIR\autotest\jobs\_clear.py}
But I have got unexpected token error with "\client\p7batch.exe"...
No matter what, you need the call operator to run something partially in a variable. Invoke-command isn't needed. Environment variables aren't needed.
& $P7_TESTING_INSTALLATION_PATH\client\p7batch.exe --log-level=error `
--run $CI_PROJECT_DIR\autotest\jobs\_clear.py