WindowsScResource

All Cookstyle Cops


The department is: Chef/Modernize

The full name of the cop is: Chef/Modernize/WindowsScResource


Enabled by default Supports autocorrection Target Chef Version
Enabled No 14.0+

The sc_windows resource from the sc cookbook allowed for the creation of windows services on legacy Chef Infra Client releases. Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions without the need for additional cookbook dependencies. See the windows_service documentation at https://docs.chef.io/resources/windows_service for additional details on creating services with the windows_service resource.

Examples

incorrect

sc_windows 'chef-client' do
  path "C:\\opscode\\chef\\bin"
  action :create
end

correct

windows_service 'chef-client' do
  action :create
  binary_path_name "C:\\opscode\\chef\\bin"
end

Configurable attributes

Name Default value Configurable values
Version Added 5.16.0 String
Exclude
  • **/metadata.rb
  • **/attributes/*.rb
  • **/Berksfile
Array

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/workstation/cookstyle/chef_modernize_windowsscresource/