From dc9f726eeb0caf23e2a91e3f3bc5cf2a874c00aa Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:48:16 +0100 Subject: [PATCH] Bug fix on long name apps added check for "| " character. Long name are weirdly truncated by powershell. Need to be removed to keep alligned collums. --- winget-update/winget-upgrade.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winget-update/winget-upgrade.ps1 b/winget-update/winget-upgrade.ps1 index 211aef1b..e281523d 100644 --- a/winget-update/winget-upgrade.ps1 +++ b/winget-update/winget-upgrade.ps1 @@ -160,7 +160,7 @@ function Get-WingetOutdated { } #Split winget output to lines - $lines = $upgradeResult.Split([Environment]::NewLine) + $lines = $upgradeResult.Split([Environment]::NewLine).Replace("¦ ","") # Find the line that starts with "------" $fl = 0 @@ -183,7 +183,7 @@ function Get-WingetOutdated { # Now cycle in real package and split accordingly $upgradeList = @() For ($i = $fl + 2; $i -le $lines.Length; $i++){ - $line = $lines[$i].Replace("¦ ","") + $line = $lines[$i] if ($line.Length -gt ($sourceStart+5) -and -not $line.StartsWith('-')){ $software = [Software]::new() $software.Name = $line.Substring(0, $idStart).TrimEnd() @@ -301,4 +301,4 @@ if (Test-Network){ #End Write-Log "End of process!" "Cyan" -Sleep 3 \ No newline at end of file +Sleep 3