From a6fc7a58de3a04f10eb11a5bc88ce8e932cd7951 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 13 Apr 2022 14:54:28 -0700 Subject: [PATCH] sort by length first and then name. --- build/azure-pipelines/product-publish.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/product-publish.ps1 b/build/azure-pipelines/product-publish.ps1 index 17b02f6aff5..5abfed48dca 100644 --- a/build/azure-pipelines/product-publish.ps1 +++ b/build/azure-pipelines/product-publish.ps1 @@ -29,8 +29,8 @@ if (Test-Path $ARTIFACT_PROCESSED_WILDCARD_PATH) { # This means that the latest artifact_processed_*.txt file has all of the contents of the previous ones. # Note: The kusto-like syntax only works in PS7+ and only in scripts, not at the REPL. Get-ChildItem $ARTIFACT_PROCESSED_WILDCARD_PATH - | Sort-Object - | Select-Object -Last 1 + # Sort by file name length first and then Name to make sure we sort numerically. Ex. 12 comes after 9. + | Sort-Object { $_.Name.Length },Name -Bottom 1 | Get-Content | ForEach-Object { $set.Add($_) | Out-Null