Romanitho / Winget-AutoUpdate

WAU daily updates apps as system and notify connected users. (Allowlist and Blocklist support)
MIT License
1.09k stars 134 forks source link

[Bug]: Scheduled Task Creation Error #656

Open GH0STDATA opened 1 month ago

GH0STDATA commented 1 month ago

The problem

I'm getting an error when trying to install Winget-AutoUpdate. I've posted a screenshot below of the settings I'm using as well as error. It loops infinitely until I close the window due to the scheduled task not being registered.

powershell_E6Nx1yuyAl

powershell_MuC2PCAAML

What version of WAU has the issue?

1.20.1

What version of Windows are you using (ex. Windows 11 22H2)?

Windows 11 23H2

What version of winget are you using?

v1.8.1911

Log information

The logs do not show the error message, it only shows in the PowerShell window. I've copied and pasted the log from the PowerShell window below, the last error message loops indefinitely.

04:20:05 - Checking prerequisites...
04:20:06 - Prerequisites checked. OK

04:20:06 - Checking if WinGet is installed/up to date.
04:20:06 - -> WinGet is up to date: v1.8.1911

04:20:06 - Installing WAU 1.20.1...
04:20:06 - -> Running fresh installation...
04:20:06 - -> Copied brand new Blacklist.
04:20:07 - -> Installing WAU scheduled tasks
Register-ScheduledTask : The parameter is incorrect.
At C:\Extra Programs\WAU Configurator\WAU\Winget-AutoUpdate-Install.ps1:217 char:9
+         Register-ScheduledTask -TaskName 'Winget-AutoUpdate' -TaskPat ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-Schedule
   dTask], CimException
    + FullyQualifiedErrorId : HRESULT 0x80070057,Register-ScheduledTask

Register-ScheduledTask : The parameter is incorrect.
At C:\Extra Programs\WAU Configurator\WAU\Winget-AutoUpdate-Install.ps1:225 char:9
+         Register-ScheduledTask -TaskName 'Winget-AutoUpdate-UserConte ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-Schedule
   dTask], CimException
    + FullyQualifiedErrorId : HRESULT 0x80070057,Register-ScheduledTask

Register-ScheduledTask : The parameter is incorrect.
At C:\Extra Programs\WAU Configurator\WAU\Winget-AutoUpdate-Install.ps1:233 char:9
+         Register-ScheduledTask -TaskName 'Winget-AutoUpdate-Notify' - ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-Schedule
   dTask], CimException
    + FullyQualifiedErrorId : HRESULT 0x80070057,Register-ScheduledTask

Register-ScheduledTask : The parameter is incorrect.
At C:\Extra Programs\WAU Configurator\WAU\Winget-AutoUpdate-Install.ps1:242 char:9
+         Register-ScheduledTask -TaskName 'Winget-AutoUpdate-Policies' ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-Schedule
   dTask], CimException
    + FullyQualifiedErrorId : HRESULT 0x80070057,Register-ScheduledTask

04:20:07 - -> Setting Registry config
04:20:07 - -> Checking Mods Directory:
04:20:07 -    The mods directory is secured!
04:20:07 - -> Checking Functions Directory:
04:20:07 -    The Functions directory is secured!
04:20:08 - -> WAU Installation succeeded!

04:20:09 - Running Winget-AutoUpdate...
Get-ScheduledTask : The system cannot find the file specified.
At C:\Extra Programs\WAU Configurator\WAU\Winget-AutoUpdate-Install.ps1:442 char:25
+ ...       while ((Get-ScheduledTask -TaskName "Winget-AutoUpdate").State  ...
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (MSFT_ScheduledTask:Root/Microsoft/...T_ScheduledTask) [Get-ScheduledTas
   k], CimException
    + FullyQualifiedErrorId : HRESULT 0x80070002,Get-ScheduledTask

Additional information

No response

KnifMelti commented 1 month ago

Started from the same path, same settings/versions.. ..sorry, can't replicate.

wjrohret commented 1 month ago

I'm getting the same issue on windows 10 22h2 OS build 19045.4651

AndrewDemski-ad-gmail-com commented 1 month ago

0x80070057 means that at least one parametry passed to cmdlet is incorrect. I'd try debugging from running in verbose Mode to see the XML structure before it is passed for registration.

GL AD


From: wjrohret @.> Sent: 09 August 2024 23:30 To: Romanitho/Winget-AutoUpdate @.> Cc: Subscribed @.***> Subject: Re: [Romanitho/Winget-AutoUpdate] [Bug]: Scheduled Task Creation Error (Issue #656)

I'm getting the same issue on windows 10 22h2 OS build 19045.4651

— Reply to this email directly, view it on GitHubhttps://github.com/Romanitho/Winget-AutoUpdate/issues/656#issuecomment-2278780981, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASAJCPQJKWE66CLVVYKGK3LZQUYIPAVCNFSM6AAAAABMCDHV7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZYG44DAOJYGE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

GH0STDATA commented 1 month ago

@AndrewDemski-ad-gmail-com how would I go about running the PowerShell script in verbose mode? I looked at the readme and I don't see a verbose flag of any kind.

AndrewDemski-ad-gmail-com commented 1 month ago

I will pretend that I did not see this question.


From: GH0STDATA @.> Sent: 12 August 2024 06:31 To: Romanitho/Winget-AutoUpdate @.> Cc: Andrzej Demski @.>; Mention @.> Subject: Re: [Romanitho/Winget-AutoUpdate] [Bug]: Scheduled Task Creation Error (Issue #656)

@AndrewDemski-ad-gmail-comhttps://github.com/AndrewDemski-ad-gmail-com how would I go about running the PowerShell script in verbose mode? I looked at the readme and I don't see a verbose flag of any kind.

— Reply to this email directly, view it on GitHubhttps://github.com/Romanitho/Winget-AutoUpdate/issues/656#issuecomment-2283094871, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASAJCPS6KLA2KUYSPHPB6OLZRA3BXAVCNFSM6AAAAABMCDHV7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBTGA4TIOBXGE. You are receiving this because you were mentioned.Message ID: @.***>

GH0STDATA commented 1 month ago

Okay, no need to be arrogant, man. I'm just asking a question. I'll pretend I didn't see that, either. Anyway, I ran Winget-AutoUpdate-Install.ps1 manually by running Windows Terminal as Administrator and it worked. Terminal was using PowerShell, by the way. I'm not sure why the GUI isn't working but I figured out a workaround in my case.

Romanitho commented 1 month ago

We are still working on an MSI installer. Our last tests look pretty good. So the GUI will disappear for something better, I hope 😇

GH0STDATA commented 1 month ago

That's good to hear!

github-actions[bot] commented 6 days ago

This issue is stale because it has been open for 30 days with no activity.