From e54ff9106255a31ad4b2951ead2c05a61c8e19f3 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 24 Nov 2025 10:55:54 -0800 Subject: [PATCH] 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 --- eng/common/scripts/Create-APIReview.ps1 | 2 +- eng/common/scripts/Validate-All-Packages.ps1 | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index ff98d4570..ec76326d9 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -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." diff --git a/eng/common/scripts/Validate-All-Packages.ps1 b/eng/common/scripts/Validate-All-Packages.ps1 index 24cfdc854..ab65e1d4b 100644 --- a/eng/common/scripts/Validate-All-Packages.ps1 +++ b/eng/common/scripts/Validate-All-Packages.ps1 @@ -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