From 78d4534eb758ff9d3b099d075864300f5650d428 Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Wed, 1 Feb 2023 04:23:03 +0100 Subject: [PATCH] No exit, log text... --- Winget-AutoUpdate/Winget-Upgrade.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Winget-AutoUpdate/Winget-Upgrade.ps1 index 351ced8..55a2e24 100644 --- a/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -277,8 +277,7 @@ if (Test-Network) { $explorerprocesses = @(Get-WmiObject -Query "Select * FROM Win32_Process WHERE Name='explorer.exe'" -ErrorAction SilentlyContinue) If ($explorerprocesses.Count -eq 0) { - Write-Log "No explorer process found / Nobody interactively logged on.. ..exiting" - Exit 0 + Write-Log "No explorer process found / Nobody interactively logged on..." } Else { @@ -296,7 +295,7 @@ if (Test-Network) { Exit 0 } elseif (!$UserScheduledTask){ - Write-Log "User context execution not installed" + Write-Log "User context execution not installed..." } } } @@ -304,6 +303,7 @@ if (Test-Network) { else { Write-Log "Critical: Winget not installed or detected, exiting..." "red" New-Item "$WorkingDir\logs\error.txt" -Value "Winget not installed or detected" -Force + Write-Log "End of process!" "Cyan" Exit 1 } }