From 31732404f6ed0c8052b89bd02c6c7bf0f788e8b0 Mon Sep 17 00:00:00 2001 From: romanitho <96626929+Romanitho@users.noreply.github.com> Date: Sat, 8 Oct 2022 03:01:32 +0200 Subject: [PATCH] Fixed user run from system task --- Winget-AutoUpdate/winget-upgrade.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Winget-AutoUpdate/winget-upgrade.ps1 b/Winget-AutoUpdate/winget-upgrade.ps1 index 1052a25..9731645 100644 --- a/Winget-AutoUpdate/winget-upgrade.ps1 +++ b/Winget-AutoUpdate/winget-upgrade.ps1 @@ -165,7 +165,7 @@ if ($IsSystem) { $UserScheduledTask = Get-ScheduledTask -TaskName "Winget-AutoUpdate-UserContext" -ErrorAction SilentlyContinue if ($UserScheduledTask){ Write-Log "Starting WAU in User context" - Start-ScheduledTask $UserScheduledTask -ErrorAction SilentlyContinue + Start-ScheduledTask $UserScheduledTask.TaskName -ErrorAction SilentlyContinue Exit 0 } else {