I was trying to change a trigger, like it shows in the Help file, but it doesn’t work, any ideas ?
Modify a trigger in a scheduled task
PS C:> $Time = New-ScheduledTaskTrigger -At 12:00 -Once
PS C:> Set-ScheduledTask –TaskName “SoftwareScan” –Trigger $Time
In this example, the first command uses the New-ScheduledTaskTrigger cmdlet to define a time trigger, to which the $Time variable is assigned.
Set-ScheduledTask : The system cannot find the file specified.
At line:1 char:3
- Set-ScheduledTask -Trigger $Time -TaskName $name
- CategoryInfo : ObjectNotFound: (PS_ScheduledTask:Root/Microsoft/…S_ScheduledTask) [Set-ScheduledTask], CimException
- FullyQualifiedErrorId : HRESULT 0x80070002,Set-ScheduledTask
Thx for the help.