Ask Your Question

# Use of Windows resource scheduled_task

I am trying to use the windows resource scheduled_task. I don't want to create the task in the default location but instead I want to put it in it's own library name. No matter what I try, I get the following error:

Error: Failed to call #<Win32::TaskScheduler::COM::TaskScheduler:0x000000093d2580>::NewWorkItem with HRESULT: -2147024893.:  The system cannot find the path specified.
Error: /Stage[main]/Puppet_agent::Init_windows/Scheduled_task[\Task Scheduler\Task Scheduler Library\Puppet\PuppetKickoff]/ensure: change from absent to present failed: Failed to call #<Win32::TaskScheduler::COM::TaskScheduler:0x000000093d2580>::NewWorkItem with HRESULT: -2147024893.:  The system cannot find the path specified.


Here is my code:

scheduled_task { '\Task Scheduler\Task Scheduler Library\Puppet\PuppetKickoff':
ensure    => present,
enabled   => true,
command   => 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe',
arguments => ' E:\\Program Files\\PuppetLabs\\bin\\run_puppet_shell.bat -Verb runas',
trigger   => {
schedule   => daily,
every      => 1,            # Specifies every other day. Defaults to 1 (every day).
start_date => '2018-08-15', # Defaults to 'today'

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2018-08-16 12:46:33 -0600

Seen: 174 times

Last updated: Aug 29