I am setting up the build process for a desktop application on Visual Studio Team Services (i.e. Visual Studio Online) and would like to run the squirrel installer Releasify command automatically under some build cases. So far I have created the following powershell script that I am running after the project gets built
Write-Host "Hello World from $Env:AGENT_NAME."
Write-Host "Current Path $env:Agent_BuildDirectory"
Write-Host "Build Number $env:Build_BuildNumber"
$squirrel = "$env:Agent_BuildDirectory\packages\squirrel.windows.*\tools\Squirrel.exe"
.$squirrel -releasify "$build_dir\MyNupkg.nupkg"
This is leading to the following error message
2015-12-29T12:57:48.5701506Z ##[error]. : The term 'C:\a\1\packages\squirrel.windows.*\tools\Squirrel.exe' is not recognized as the name of a cmdlet,
2015-12-29T12:57:48.5701506Z ##[error]function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
2015-12-29T12:57:48.5701506Z ##[error]path is correct and try again.
2015-12-29T12:57:48.5701506Z ##[error]At C:\a\1\s\MyDir\Release.ps1:5 char:2
2015-12-29T12:57:48.5701506Z ##[error]+ .$squirrel -releasify "$build_dir\MyNupkg.nupkg"
2015-12-29T12:57:48.5701506Z ##[error]+ ~~~~~~~~~
2015-12-29T12:57:48.5701506Z ##[error] + CategoryInfo : ObjectNotFound: (C:\a\1\packages...ls\Squirrel.exe:String) [], CommandNotFoundException
2015-12-29T12:57:48.5701506Z ##[error] + FullyQualifiedErrorId : CommandNotFoundException
2015-12-29T12:57:48.5701506Z ##[error]
2015-12-29T12:57:48.5701506Z ##[error]Process completed with exit code 0 and had 1 error(s) written to the error stream.
How can I fix this error? Is there a better approach? Why can't powershell run a program that is in that directory?