From 331c1f160e709b4c4c31339686224daebad4b5cb Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Fri, 8 Apr 2022 00:50:28 +0200 Subject: [PATCH] Logical optimization --- 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 fb1298c..a7cfed0 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("¦ ","") + $lines = $upgradeResult.Split([Environment]::NewLine).Replace("¦ ","") | Where-Object {$_} # Find the line that starts with "------" $fl = 0 @@ -51,8 +51,8 @@ function Get-WingetOutdatedApps { $fl++ } - #Get header line - $fl = $fl - 2 + #Get header line + $fl = $fl - 1 #Get header titles $index = $lines[$fl] -split '\s+'