Cannot find PowerShell script by path specified in build configuration settings
Hi,
I'm running cake script on TeamCity Linux agent.
When a branch is new I will get this error message
Step 2/7: Build and Test (PowerShell) < 1s
PowerShell Executable: /opt/microsoft/powershell/7/pwsh
Working directory: /mnt/agent/work/20cf98ee347137a6
Cannot find PowerShell script by path specified in build configuration settings: /mnt/agent/work/20cf98ee347137a6/build.ps1 (absolute path on agent). Please check that the specified path is correct.
Step Build and Test (PowerShell) failed with unexpected error

Then I will run this build again manually it will run correctly:
Step 2/7: Build and Test (PowerShell) 6m 28s
PowerShell Executable: /opt/microsoft/powershell/7/pwsh
Working directory: /mnt/agent/work/bc7af00cd3456d5
Wrapper script: /mnt/agent/temp/buildTmp/powershell_gen_164742946623517030414751023599258.sh
Command: /opt/microsoft/powershell/7/pwsh -NoProfile -NonInteractive -File /mnt/agent/temp/buildTmp/powershell6700951232011379278.ps1 --Target=BuildTestAndPublishTestResult
Current location /mnt/agent/work/bc7af00cd3456d5
Tool 'cake.tool' (version '2.0.0') was restored. Available commands: dotnet-cake

I see that we dont have a Wrapper script first time the build run.
This is my build step config:

Please sign in to leave a comment.