我正在为 Visual Studio Team Services(即 Visual Studio Online)上的桌面应用程序设置构建过程,并希望在某些构建案例下自动运行 squirrel 安装程序 Releasify 命令。到目前为止,我已经创建了以下我在项目构建后运行的 powershell 脚本
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"
这导致以下错误消息
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.
我该如何解决这个错误?有更好的方法吗?为什么 powershell 不能运行该目录中的程序?