Sync eng/common directory with azure-sdk-tools for PR 13045 (#6841)

* Enforce an array for single element

* Enforced an array for where filter

---------

Co-authored-by: ray chen <raychen@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-11-24 10:55:54 -08:00 committed by GitHub
parent 102c9be4c6
commit e54ff91062
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View File

@ -374,7 +374,7 @@ elseif ($PackageInfoFiles -and $PackageInfoFiles.Count -gt 0) {
# Lowest Priority: Direct PackageInfoFiles (new method)
Write-Host "Using PackageInfoFiles parameter with $($PackageInfoFiles.Count) files"
# Filter out empty strings or whitespace-only entries
$ProcessedPackageInfoFiles = $PackageInfoFiles | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }
$ProcessedPackageInfoFiles = @($PackageInfoFiles | Where-Object { -not [string]::IsNullOrWhiteSpace($_) })
}
else {
Write-Error "No package information provided. Please provide either 'PackageName', 'ArtifactList', or 'PackageInfoFiles' parameters."

View File

@ -278,12 +278,11 @@ if ($ArtifactList -and $ArtifactList.Count -gt 0)
}
}
}
elseif ($PackageInfoFiles -and $PackageInfoFiles.Count -gt 0)
{
elseif ($PackageInfoFiles -and $PackageInfoFiles.Count -gt 0) {
# Direct PackageInfoFiles (new method)
Write-Host "Using PackageInfoFiles parameter with $($PackageInfoFiles.Count) files"
# Filter out empty strings or whitespace-only entries
$ProcessedPackageInfoFiles = $PackageInfoFiles | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }
$ProcessedPackageInfoFiles = @($PackageInfoFiles | Where-Object { -not [string]::IsNullOrWhiteSpace($_) })
}
# Validate that we have package info files to process