Improve messages and behavior when there's a problem in finding zip files (#15284)

This commit is contained in:
James Truher [MSFT] authored and GitHub committed 2021-04-20 16:04:49 -07:00
1 parent b5e41e2587
commit 2f0cc3b0f8
1 file changed
+10 -2
@@ -76,8 +76,16 @@ jobs:
displayName: Install packaging tools
- powershell: |
$zipPath = Get-Item '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip'
Write-Verbose -Verbose "Zip Path: $zipPath"
$zipPathString = '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip'
Write-Verbose -Verbose "Zip Path: $zipPathString"
$zipPath = Get-Item $zipPathString
if(@($zipPath).Count -eq 0) {
throw "No files found at '$zipPathString'"
}
elseif(@($zipPath).Count -ne 1) {
$names = $zipPath.Name -join "', '"
throw "multiple files '${names}' found with '${zipPathString}'"
}
$expandedFolder = $zipPath.BaseName
Write-Host "sending.. vso[task.setvariable variable=SymbolsFolder]$expandedFolder"