mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Merged PR 30666: [release/v7.3.12] Verify environment variable for OneBranch before we try to copy (#21441)
Verify environment variable for OneBranch before we try to copy (#21441)
This commit is contained in:
@@ -48,13 +48,20 @@ function New-BuildInfoJson {
|
||||
Write-Verbose -Message "$vstsCommandString" -Verbose
|
||||
Write-Host -Object "##$vstsCommandString"
|
||||
|
||||
# Upload for ADO pipelines
|
||||
Write-Host "##vso[artifact.upload containerfolder=BuildInfoJson;artifactname=BuildInfoJson]$resolvedPath"
|
||||
|
||||
# Copy to location where OneBranch Pipelines uploads from
|
||||
|
||||
# if the environment variable does not exist, we are not in OneBranch. So just return.
|
||||
if (-not $env:ob_outputDirectory) {
|
||||
return
|
||||
}
|
||||
|
||||
if (-not (Test-Path $env:ob_outputDirectory)) {
|
||||
$null = New-Item -Path $env:ob_outputDirectory -ItemType Directory -Force -Verbose
|
||||
}
|
||||
|
||||
# Upload for ADO pipelines
|
||||
Write-Host "##vso[artifact.upload containerfolder=BuildInfoJson;artifactname=BuildInfoJson]$resolvedPath"
|
||||
# Copy to location where OneBranch Pipelines uploads from
|
||||
Copy-Item $resolvedPath -Destination $env:ob_outputDirectory -Force -Verbose
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user