WriteAscii icon indicating copy to clipboard operation
WriteAscii copied to clipboard

Please update PSGallery with 1.3.0

Open scwat-github opened this issue 11 months ago • 5 comments

Hi

Any chance you could push the Sort-Object fix to PSGallery please? 1.2.2.1 is there and it's still showing as Sort on one of the lines, bit painful fixing it in some ADO pipelines. Thanks for the module!

$LetterArray = [string[]]($Letters.GetEnumerator() | Sort Name | Select -ExpandProperty Name)

scwat-github avatar Dec 24 '24 11:12 scwat-github

Yeah, I will fix it one of these days. Didn't realize it was mission-critical for any enterprise! :D Need to boot into Windows...

EliteLoser avatar Jan 21 '25 10:01 EliteLoser

It's great for separating sections out in the logs :)

scwat-github avatar Jan 21 '25 10:01 scwat-github

Status update: Today I tried to boot into Windows. Long story short: after 5 bluescreens (some of which were displayed distorted) and a broken install trying to update, I failed to access Windows in the end. I think I need a clean install. Don't have a Windows license - and my company is no longer income, but an expense to keep the server running, so it could take a while...

EliteLoser avatar Feb 27 '25 17:02 EliteLoser

As for fixing it after download, it's not too hard (although atrocious stylistically - I tried to gain access to Windows so I could fix it, but failed...).

I tested a simple, exact-match regex on my command line:

'$LetterArray = [string[]]($Letters.GetEnumerator() | Sort Name | Select -ExpandProperty Name)' -replace '\$LetterArray = \[string\[\]\]\(\$Letters\.GetEnumerator\(\) \| Sort Name \| Select -ExpandProperty Name\)', '$LetterArray = [string[]]($Letters.GetEnumerator() | Sort-Object -Property Name | Select-Object -ExpandProperty Name)'

$LetterArray = [string[]]($Letters.GetEnumerator() | Sort-Object -Property Name | Select-Object -ExpandProperty Name)

So you could use that on the whole file, to make the code simpler (after all the line isn't elsewhere and therefore doesn't match elsewhere, and if it did, I guess you would want this anyway).

Such as:

(Get-Content -LiteralPath $OldFile) -replace '\$LetterArray = \[string\[\]\]\(\$Letters\.GetEnumerator\(\) \| Sort Name \| Select -ExpandProperty Name\)', '$LetterArray = [string[]]($Letters.GetEnumerator() | Sort-Object -Property Name | Select-Object -ExpandProperty Name)' | Set-Content -Encoding utf8 -Path $NewFixedFile

Yeah, I wish I could fix it though...

EliteLoser avatar Feb 27 '25 18:02 EliteLoser

My workaround was to make "sort" an alias for "Sort-Object" in the Powershell Profile ($PROFILE)

Set-Alias "sort" "Sort-Object"

turbosnute avatar Jul 17 '25 11:07 turbosnute