summaryrefslogtreecommitdiff
path: root/lib/chef/resource/windows_task.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/windows_task.rb')
-rw-r--r--lib/chef/resource/windows_task.rb190
1 files changed, 95 insertions, 95 deletions
diff --git a/lib/chef/resource/windows_task.rb b/lib/chef/resource/windows_task.rb
index b1154a1f08..02e4f7fe87 100644
--- a/lib/chef/resource/windows_task.rb
+++ b/lib/chef/resource/windows_task.rb
@@ -34,118 +34,118 @@ class Chef
description "Use the **windows_task** resource to create, delete or run a Windows scheduled task."
introduced "13.0"
examples <<~DOC
- **Create a scheduled task to run every 15 minutes as the Administrator user**:
-
- ```ruby
- windows_task 'chef-client' do
- user 'Administrator'
- password 'password'
- command 'chef-client'
- run_level :highest
- frequency :minute
- frequency_modifier 15
- end
- ```
+ **Create a scheduled task to run every 15 minutes as the Administrator user**:
+
+ ```ruby
+ windows_task 'chef-client' do
+ user 'Administrator'
+ password 'password'
+ command 'chef-client'
+ run_level :highest
+ frequency :minute
+ frequency_modifier 15
+ end
+ ```
- **Create a scheduled task to run every 2 days**:
+ **Create a scheduled task to run every 2 days**:
- ```ruby
- windows_task 'chef-client' do
- command 'chef-client'
- run_level :highest
- frequency :daily
- frequency_modifier 2
- end
- ```
+ ```ruby
+ windows_task 'chef-client' do
+ command 'chef-client'
+ run_level :highest
+ frequency :daily
+ frequency_modifier 2
+ end
+ ```
- **Create a scheduled task to run on specific days of the week**:
+ **Create a scheduled task to run on specific days of the week**:
- ```ruby
- windows_task 'chef-client' do
- command 'chef-client'
- run_level :highest
- frequency :weekly
- day 'Mon, Thu'
- end
- ```
+ ```ruby
+ windows_task 'chef-client' do
+ command 'chef-client'
+ run_level :highest
+ frequency :weekly
+ day 'Mon, Thu'
+ end
+ ```
- **Create a scheduled task to run only once**:
+ **Create a scheduled task to run only once**:
- ```ruby
- windows_task 'chef-client' do
- command 'chef-client'
- run_level :highest
- frequency :once
- start_time '16:10'
- end
- ```
+ ```ruby
+ windows_task 'chef-client' do
+ command 'chef-client'
+ run_level :highest
+ frequency :once
+ start_time '16:10'
+ end
+ ```
- **Create a scheduled task to run on current day every 3 weeks and delay upto 1 min**:
+ **Create a scheduled task to run on current day every 3 weeks and delay upto 1 min**:
- ```ruby
- windows_task 'chef-client' do
- command 'chef-client'
- run_level :highest
- frequency :weekly
- frequency_modifier 3
- random_delay '60'
- end
- ```
+ ```ruby
+ windows_task 'chef-client' do
+ command 'chef-client'
+ run_level :highest
+ frequency :weekly
+ frequency_modifier 3
+ random_delay '60'
+ end
+ ```
- **Create a scheduled task to run weekly starting on Dec 28th 2018**:
+ **Create a scheduled task to run weekly starting on Dec 28th 2018**:
- ```ruby
- windows_task 'chef-client 8' do
- command 'chef-client'
- run_level :highest
- frequency :weekly
- start_day '12/28/2018'
- end
- ```
+ ```ruby
+ windows_task 'chef-client 8' do
+ command 'chef-client'
+ run_level :highest
+ frequency :weekly
+ start_day '12/28/2018'
+ end
+ ```
- **Create a scheduled task to run every Monday, Friday every 2 weeks**:
+ **Create a scheduled task to run every Monday, Friday every 2 weeks**:
- ```ruby
- windows_task 'chef-client' do
- command 'chef-client'
- run_level :highest
- frequency :weekly
- frequency_modifier 2
- day 'Mon, Fri'
- end
- ```
+ ```ruby
+ windows_task 'chef-client' do
+ command 'chef-client'
+ run_level :highest
+ frequency :weekly
+ frequency_modifier 2
+ day 'Mon, Fri'
+ end
+ ```
- **Create a scheduled task to run when computer is idle with idle duration 20 min**:
+ **Create a scheduled task to run when computer is idle with idle duration 20 min**:
- ```ruby
- windows_task 'chef-client' do
- command 'chef-client'
- run_level :highest
- frequency :on_idle
- idle_time 20
- end
- ```
+ ```ruby
+ windows_task 'chef-client' do
+ command 'chef-client'
+ run_level :highest
+ frequency :on_idle
+ idle_time 20
+ end
+ ```
- **Delete a task named "old task"**:
- ```ruby
- windows_task 'old task' do
- action :delete
- end
- ```
+ **Delete a task named "old task"**:
+ ```ruby
+ windows_task 'old task' do
+ action :delete
+ end
+ ```
- **Enable a task named "chef-client"**:
- ```ruby
- windows_task 'chef-client' do
- action :enable
- end
- ```
+ **Enable a task named "chef-client"**:
+ ```ruby
+ windows_task 'chef-client' do
+ action :enable
+ end
+ ```
- **Disable a task named "ProgramDataUpdater" with TaskPath "\\Microsoft\\Windows\\Application Experience\\ProgramDataUpdater"**
- ```ruby
- windows_task '\\Microsoft\\Windows\\Application Experience\\ProgramDataUpdater' do
- action :disable
- end
- ```
+ **Disable a task named "ProgramDataUpdater" with TaskPath "\\Microsoft\\Windows\\Application Experience\\ProgramDataUpdater"**
+ ```ruby
+ windows_task '\\Microsoft\\Windows\\Application Experience\\ProgramDataUpdater' do
+ action :disable
+ end
+ ```
DOC
allowed_actions :create, :delete, :run, :end, :enable, :disable, :change