[Bug]: Error The argument for the parameter "Action" cannot be checked.
The problem
When trying to install it, I get the following error. (As parts of the error were output in my systems language german I used DeepL to translate these to english.)
888 888 d8888 888 888
888 o 888 d88888 888 888
888 d8b 888 d88P888 888 888
888 d888b 888 d88P 888 888 888
888d88888b888 d88P 888 888 888
88888P Y88888 d88P 888 888 888
8888P Y8888 d88P 888 888 888
888P Y888 d88P 888 Y8888888P
Winget-AutoUpdate 1.20.0
https://github.com/Romanitho/Winget-AutoUpdate
________________________________________________________
################################################################
# 20.05.2024 - INSTALL WAU
################################################################
18:30:14 - Check prerequisites...
18:30:15 - Prerequisites checked. OK
18:30:15 - Check if WinGet is installed/updated.
18:30:15 - -> WinGet is up to date: v1.7.11261
18:30:15 - Install WAU...
18:30:15 - -> Update the previous installation...
18:30:15 - -> Copy brand new blacklist.
18:30:17 - -> Install the scheduled WAU tasks
New-ScheduledTaskAction : Invalid class
In R:\WAU\Winget-AutoUpdate-Install.ps1:188 characters:23
+ ... askAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argume ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [New-ScheduledTaskAction], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,New-ScheduledTaskAction
New-ScheduledTaskTrigger : Invalid class
In R:\WAU\Winget-AutoUpdate-Install.ps1:191 chars:30
+ $tasktriggers += New-ScheduledTaskTrigger -AtLogOn
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [New-ScheduledTaskTrigger], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,New-ScheduledTaskTrigger
New-ScheduledTaskPrincipal : Invalid class
In R:\WAU\Winget-AutoUpdate-Install.ps1:208 characters:30
+ ... Principal = New-ScheduledTaskPrincipal -UserId S-1-5-18 -RunLevel Hig ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [New-ScheduledTaskPrincipal], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,New-ScheduledTaskPrincipal
New-ScheduledTaskSettingsSet : Invalid class
In R:\WAU\Winget-AutoUpdate-Install.ps1:209 chars:25
+ ... kSettings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWh ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [New-ScheduledTaskSettingsSet], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041010,New-ScheduledTaskSettingsSet
18:30:18 - -> WAU installation failed! Error The argument for the parameter "Action" cannot be checked. The argument is NULL or empty. Specify an argument that is not NULL or empty and run the command again. - Try to run me with administrator rights.
Incorrect
18:30:21 - End of the process.
I tried to run the script with administrator rights, but it doesn't even start that way.
What version of WAU has the issue?
1.20.0
What version of Windows are you using (ex. Windows 11 22H2)?
Win11 23H2 Build 22631.3593
What version of winget are you using?
v1.7.11261
Log information
No response
Additional information
No response
Hey BlankFX1,
Not that using the original outputs would be useful while googling for the results, but it seems that PowerShell on your machine has some problem with ScheduledTasks module.
Could you perform a quick test and see if it is working for you in ISE?
(in the same execution context you previously used to install WAU)
What test exactly do you want me to perform? I started ISE and was able to verify that ScheduledTasks is listed in the shown Modules dropdown. I also loaded in Winget-AutoUpdate-Install.ps1 and executed it, giving me this log:
################################################################
# 21.05.2024 - INSTALLING WAU
################################################################
01:21:20 - Checking prerequisites...
01:21:20 - Prerequisites checked failed
01:21:20 - Checking if WinGet is installed/up to date.
01:21:21 - -> WinGet is not installed
01:21:21 - -> Downloading WinGet MSIXBundle for App Installer...
01:21:30 - -> Installing WinGet MSIXBundle for App Installer...
01:21:30 - -> Failed to install WinGet MSIXBundle for App Installer...
01:21:30 - -> Forcing an upgrade of Store Apps...
01:21:35 - -> ...this can take a minute!
01:21:35 - -> ...something went wrong!
01:21:35 - Winget is mandatory to execute WAU.
01:21:35 - End of process.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.