Forum Discussion
dmarquesgn
Sep 13, 2022Iron Contributor
Create new-scheduletaskaction and execute powershell command within a variable
Hi, I've developing some scripts to automate some tasks, like managing Windows Updates by using the PSWindowsUpdate module. Now I'm at the stage where I got a variable with the update I need to do,...
- Sep 13, 2022
You need to specify it as argument, so :
$taskAction = New-ScheduledTaskAction -Execute 'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe' -Argument $UpdateString'
Sep 13, 2022
You need to specify it as argument, so :
$taskAction = New-ScheduledTaskAction -Execute 'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe' -Argument $UpdateString'
dmarquesgn
Sep 13, 2022Iron Contributor
Ok, just tried that and it worked.
Thanks
Thanks