Skip to content

Commit

Permalink
Bug fix on long name apps
Browse files Browse the repository at this point in the history
added check for "| " character. Long name are weirdly truncated by powershell. Need to be removed to keep alligned collums.
  • Loading branch information
Romanitho authored Feb 3, 2022
1 parent 68693fc commit dc9f726
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions winget-update/winget-upgrade.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -301,4 +301,4 @@ if (Test-Network){

#End
Write-Log "End of process!" "Cyan"
Sleep 3
Sleep 3

0 comments on commit dc9f726

Please sign in to comment.