2
votes

I have setup a build definition in Visual Studio Team Services (was Visual Studio Online) builds.

Below is a snapshot of Powershell script setup: enter image description here

I haven't set anything in 'Working folder' as I am assuming that it defaults to the folder where the script lives as specified in the info.

When build runs, it throws an exception at the Powershell step.

Below is the error snapshot: enter image description here

Somehow the working folder is not the folder where the script is located. Any suggestions to fix it?

1

1 Answers

5
votes

Use the powershell variable $PSScriptRoot to get the directory where your script is, and use that to figure out all other paths.