相关疑难解决方法(0)

为什么我的PowerShell退出代码始终为"0"?

我有一个PowerShell脚本如下

##teamcity[progressMessage 'Beginning build']
# If the build computer is not running the appropriate version of .NET, then the build will not run. Throw an error immediately.
if( (ls "$env:windir\Microsoft.NET\Framework\v4.0*") -eq $null ) {
    throw "This project requires .NET 4.0 to compile. Unfortunately .NET 4.0 doesn't appear to be installed on this machine."
    ##teamcity[buildStatus status='FAILURE' ]
}

##teamcity[progressMessage 'Setting up variables']
# Set up variables for the build script
$invocation = (Get-Variable MyInvocation).Value
$directorypath = Split-Path $invocation.MyCommand.Path
$v4_net_version = (ls …
Run Code Online (Sandbox Code Playgroud)

powershell teamcity exit-code

71
推荐指数
3
解决办法
4万
查看次数

标签 统计

exit-code ×1

powershell ×1

teamcity ×1