If !$TestWinget no need to continue?
parent
e5bc0b663c
commit
21b5fa8269
|
@ -165,23 +165,23 @@ if (Test-Network) {
|
||||||
if ($InstallOK -eq 0) {
|
if ($InstallOK -eq 0) {
|
||||||
Write-Log "No new update." "Green"
|
Write-Log "No new update." "Green"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#Run WAU in user context if currently as system
|
#Run WAU in user context if currently as system
|
||||||
if ($IsSystem) {
|
if ($IsSystem) {
|
||||||
|
|
||||||
#Get Winget system apps to excape them befor running user context
|
#Get Winget system apps to excape them befor running user context
|
||||||
Get-WingetSystemApps
|
Get-WingetSystemApps
|
||||||
|
|
||||||
#Run user context scheduled task
|
#Run user context scheduled task
|
||||||
$UserScheduledTask = Get-ScheduledTask -TaskName "Winget-AutoUpdate-UserContext" -ErrorAction SilentlyContinue
|
$UserScheduledTask = Get-ScheduledTask -TaskName "Winget-AutoUpdate-UserContext" -ErrorAction SilentlyContinue
|
||||||
if ($UserScheduledTask) {
|
if ($UserScheduledTask) {
|
||||||
Write-Log "Starting WAU in User context"
|
Write-Log "Starting WAU in User context"
|
||||||
Start-ScheduledTask $UserScheduledTask.TaskName -ErrorAction SilentlyContinue
|
Start-ScheduledTask $UserScheduledTask.TaskName -ErrorAction SilentlyContinue
|
||||||
Exit 0
|
Exit 0
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-Log "User context execution not installed"
|
Write-Log "User context execution not installed"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue