8000 Improve messages and behavior when there's a problem in finding zip f… · rkeithhill/PowerShell@b51b8de · GitHub
[go: up one dir, main page]

Skip to content

Commit b51b8de

Browse files
JamesWTruherrkeithhill
authored andcommitted
Improve messages and behavior when there's a problem in finding zip files (PowerShell#15284)
1 parent ff2f4d8 commit b51b8de

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/releaseBuild/azureDevOps/templates/windows-packaging.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,16 @@ jobs:
7676
displayName: Install packaging tools
7777
7878
- powershell: |
79-
$zipPath = Get-Item '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip'
80-
Write-Verbose -Verbose "Zip Path: $zipPath"
79+
$zipPathString = '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip'
80+
Write-Verbose -Verbose "Zip Path: $zipPathString"
81+
$zipPath = Get-Item $zipPathString
82+
if(@($zipPath).Count -eq 0) {
83+
throw "No files found at '$zipPathString'"
84+
}
85+
elseif(@($zipPath).Count -ne 1) {
86+
$names = $zipPath.Name -join "', '"
87+
throw "multiple files '${names}' found with '${zipPathString}'"
88+
}
8189
8290
$expandedFolder = $zipPath.BaseName
8391
Write-Host "sending.. vso[task.setvariable variable=SymbolsFolder]$expandedFolder"

0 commit comments

Comments
 (0)
0