mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Ignore last exit code in the build step as dotnet may return error when SDK is not installed (#11972)
This commit is contained in:
+3
-3
@@ -342,7 +342,7 @@ function Start-PSBuild {
|
||||
}
|
||||
|
||||
# Verify if the dotnet in-use is the required version
|
||||
$dotnetCLIInstalledVersion = (dotnet --version)
|
||||
$dotnetCLIInstalledVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode
|
||||
If ($dotnetCLIInstalledVersion -ne $dotnetCLIRequiredVersion) {
|
||||
Write-Warning @"
|
||||
The currently installed .NET Command Line Tools is not the required version.
|
||||
@@ -1837,7 +1837,7 @@ function Start-PSBootstrap {
|
||||
$dotNetExists = precheck 'dotnet' $null
|
||||
$dotNetVersion = [string]::Empty
|
||||
if($dotNetExists) {
|
||||
$dotNetVersion = (dotnet --version)
|
||||
$dotNetVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode
|
||||
}
|
||||
|
||||
if(!$dotNetExists -or $dotNetVersion -ne $dotnetCLIRequiredVersion -or $Force.IsPresent) {
|
||||
@@ -2017,7 +2017,7 @@ function Find-Dotnet() {
|
||||
if (precheck dotnet) {
|
||||
# Must run from within repo to ensure global.json can specify the required SDK version
|
||||
Push-Location $PSScriptRoot
|
||||
$dotnetCLIInstalledVersion = (dotnet --version)
|
||||
$dotnetCLIInstalledVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode
|
||||
Pop-Location
|
||||
if ($dotnetCLIInstalledVersion -ne $dotnetCLIRequiredVersion) {
|
||||
Write-Warning "The 'dotnet' in the current path can't find SDK version ${dotnetCLIRequiredVersion}, prepending $dotnetPath to PATH."
|
||||
|
||||
Reference in New Issue
Block a user