I am running on a windows PC a runner with the setting
shell = “powershell”
From gitlab CI/CD I call a powershell script this way:
> powershell -File ./script.ps1
> - echo $LASTEXITCODE
> - echo $?
Now the executing job gives following information:
$ echo $LASTEXITCODE
$ echo $?
Cleaning up file based variables
=> Here the script fails with the ExitCode=1 but the Job succeeded!!??
why I can not read the correct ExitCode with gitlab?