From 46f15becd8aefbc905e54f4fda4d6d4d3bf7db36 Mon Sep 17 00:00:00 2001 From: romanitho <96626929+Romanitho@users.noreply.github.com> Date: Thu, 2 Nov 2023 18:22:29 +0100 Subject: [PATCH] Extra Line removed (logs) --- Winget-AutoUpdate-Install.ps1 | 10 ++++++++-- Winget-AutoUpdate/functions/Update-WinGet.ps1 | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Winget-AutoUpdate-Install.ps1 b/Winget-AutoUpdate-Install.ps1 index 801d3cf..900a13e 100644 --- a/Winget-AutoUpdate-Install.ps1 +++ b/Winget-AutoUpdate-Install.ps1 @@ -538,8 +538,14 @@ Write-Host "`t________________________________________________________`n `n " if (!$Uninstall) { Write-ToLog "Installing WAU to $WAUinstallPath\" Install-Prerequisites - Update-Winget - Install-WingetAutoUpdate + $UpdateWinget = Update-Winget + if ($UpdateWinget -ne "fail") { + Write-Host "`r" #Extra Line in console only + Install-WingetAutoUpdate + } + else { + Write-ToLog "Winget is mandatory to execute WAU." "Red" + } } else { Write-ToLog "Uninstalling WAU..." diff --git a/Winget-AutoUpdate/functions/Update-WinGet.ps1 b/Winget-AutoUpdate/functions/Update-WinGet.ps1 index 575d869..4aa52a0 100644 --- a/Winget-AutoUpdate/functions/Update-WinGet.ps1 +++ b/Winget-AutoUpdate/functions/Update-WinGet.ps1 @@ -68,17 +68,17 @@ Function Update-WinGet { #If multiple versions, pick most recent one $WingetCmd = $WingetInfo[-1].FileName & $WingetCmd source reset --force - Write-ToLog "-> WinGet sources reset.`n" "green" + Write-ToLog "-> WinGet sources reset." "green" $return = "success" } catch { - Write-ToLog "-> Failed to install WinGet MSIXBundle for App Installer...`n" "red" + Write-ToLog "-> Failed to install WinGet MSIXBundle for App Installer..." "red" #Force Store Apps to update Update-StoreApps $return = "fail" } - + #Remove WinGet MSIXBundle Remove-Item -Path $WingetInstaller -Force -ErrorAction SilentlyContinue @@ -86,7 +86,7 @@ Function Update-WinGet { return $return } else { - Write-ToLog "-> WinGet is up to date: v$WinGetInstalledVersion`n" "Green" + Write-ToLog "-> WinGet is up to date: v$WinGetInstalledVersion" "Green" return "current" } }