WinGet doesn't work via Schedule Tasks #811
Unanswered
haavarstein
asked this question in
Q&A
Replies: 2 comments
|
As it ships as an MSIX package, it is required to run under a user context that has registered it. Is your scheduled task set to run as you and only when you are logged in? |
0 replies
|
Great catch, its running as SYSTEM whenever logged in or not. Hmm maybe better to use AutoLogon and shortcut in StartUp folder instead. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Brief description of your issue
WinGet doesn't work via Schedule Tasks
Please use this section to describe your issue. This could be a repeat of the title, or maybe you have more to say.
WinGet doesn't work via Schedule Tasks - Build Pipe Line
Running given PowerShell script, kicked off by a schedule task, Win-Get doesn't seem to work. When I run the script locally it works as expected.
Missing output text file, so download doesn't work, see example script below.
If ($App.Enabled -eq "True" -and $App.WinGet -eq "True") {
Write-Verbose "Download Method for $Product is WinGet" -Verbose
$File = "$Product" + ".txt"
WinGet show "$Product" | Out-File $File
WinGet show "$Product" | Out-File $File
(Get-Content $File| Select-Object -Skip 2) | Set-Content $File
$PsYaml = ConvertFrom-Yaml (cat -raw $File)
$Version = $PsYaml.Version
$URL = $PsYaml.Installer.'Download Url'
$Source = "$PackageName" + "" + "$Version" + "" + "$Architecture" + "." + "$InstallerType"
[winget --info]
Windows: Windows.Desktop v10.0.19042.631
Package: Microsoft.DesktopAppInstaller v1.11.10191.0
All reactions