From d85672956d859fba4a5fb8883de0367126004627 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Fri, 8 Apr 2022 18:30:58 +0200 Subject: [PATCH] Prepare prerelease Winget version --- Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 b/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 index a7cfed0..e2d9ec4 100644 --- a/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 +++ b/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 @@ -43,7 +43,7 @@ function Get-WingetOutdatedApps { } #Split winget output to lines - $lines = $upgradeResult.Split([Environment]::NewLine).Replace("¦ ","") | Where-Object {$_} + $lines = $upgradeResult.Split([Environment]::NewLine) | Where-Object {$_} # Find the line that starts with "------" $fl = 0 @@ -57,7 +57,7 @@ function Get-WingetOutdatedApps { #Get header titles $index = $lines[$fl] -split '\s+' - # Line $i has the header, we can find char where we find ID and Version + # Line $fl has the header, we can find char where we find ID and Version $idStart = $lines[$fl].IndexOf($index[1]) $versionStart = $lines[$fl].IndexOf($index[2]) $availableStart = $lines[$fl].IndexOf($index[3]) @@ -67,7 +67,7 @@ function Get-WingetOutdatedApps { $upgradeList = @() For ($i = $fl + 2; $i -le $lines.Length; $i++){ $line = $lines[$i] - if ($line.Length -gt ($sourceStart+5) -and -not $line.StartsWith('-')){ + if ($line.Length -gt ($sourceStart+5) -and -not $line.Contains("--include-unknown")){ $software = [Software]::new() $software.Name = $line.Substring(0, $idStart).TrimEnd() $software.Id = $line.Substring($idStart, $versionStart - $idStart).TrimEnd()