Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

The windows cookbook has been deprecated

Author provided reason for deprecation:

The windows cookbook has been deprecated and is no longer being maintained by its authors. Use of the windows cookbook is no longer recommended.

RSS

windows (131) Versions 1.43.0

Provides a set of useful Windows-specific primitives.

Policyfile
Berkshelf
Knife
cookbook 'windows', '= 1.43.0', :supermarket
cookbook 'windows', '= 1.43.0'
knife supermarket install windows
knife supermarket download windows
README
Dependencies
Changelog
Quality 0%

Windows Cookbook

Build Status
Cookbook Version

Provides a set of Windows-specific primitives (Chef resources) meant to aid in the creation of cookbooks/recipes targeting the Windows platform.

Requirements

Platforms

  • Windows Vista
  • Windows 7
  • Windows Server 2008 (R1, R2)
  • Windows 8, 8.1
  • Windows Server 2012 (R1, R2)

Chef

  • Chef 11+

Cookbooks

  • chef_handler (windows::reboot_handler leverages the chef_handler LWRP)

Attributes

  • node['windows']['allow_pending_reboots'] - used to configure the WindowsRebootHandler (via the windows::reboot_handler recipe) to act on pending reboots. default is true (ie act on pending reboots). The value of this attribute only has an effect if the windows::reboot_handler is in a node's run list.
  • node['windows']['allow_reboot_on_failure'] - used to register the WindowsRebootHandler (via the windows::reboot_handler recipe) as an exception handler too to act on reboots not only at the end of successful Chef runs, but even at the end of failed runs. default is false (ie reboot only after successful runs). The value of this attribute only has an effect if the windows::reboot_handler is in a node's run list.

Resource/Provider

windows_auto_run

Actions

  • :create - Create an item to be run at login
  • :remove - Remove an item that was previously setup to run at login

Attribute Parameters

  • name - Name attribute. The name of the value to be stored in the registry
  • program - The program to be run at login
  • args - The arguments for the program

Examples

Run BGInfo at login

windows_auto_run 'BGINFO' do
  program 'C:/Sysinternals/bginfo.exe'
  args    '\'C:/Sysinternals/Config.bgi\' /NOLICPROMPT /TIMER:0'
  not_if  { Registry.value_exists?(AUTO_RUN_KEY, 'BGINFO') }
  action  :create
end

windows_batch

This resource is now deprecated and will be removed in a future version of this cookbook. Chef >= 11.6.0 includes a built-in batch resource.

Execute a batch script using the cmd.exe interpreter (much like the script resources for bash, csh, powershell, perl, python and ruby). A temporary file is created and executed like other script resources, rather than run inline. By their nature, Script resources are not idempotent, as they are completely up to the user's imagination. Use the not_if or only_if meta parameters to guard the resource for idempotence.

Actions

  • :run - run the batch file

Attribute Parameters

  • command - name attribute. Name of the command to execute.
  • code - quoted string of code to execute.
  • creates - a file this command creates - if the file exists, the command will not be run.
  • cwd - current working directory to run the command from.
  • flags - command line flags to pass to the interpreter when invoking.
  • user - A user name or user ID that we should change to before running this command.
  • group - A group name or group ID that we should change to before running this command.

Examples

windows_batch 'unzip_and_move_ruby' do
  code <<-EOH
  7z.exe x #{Chef::Config[:file_cache_path]}/ruby-1.8.7-p352-i386-mingw32.7z  -oC:\\source -r -y
  xcopy C:\\source\\ruby-1.8.7-p352-i386-mingw32 C:\\ruby /e /y
  EOH
end
windows_batch 'echo some env vars' do
  code <<-EOH
  echo %TEMP%
  echo %SYSTEMDRIVE%
  echo %PATH%
  echo %WINDIR%
  EOH
end

windows_certificate

Installs a certificate into the Windows certificate store from a file, and grants read-only access to the private key for designated accounts.
Due to current limitations in winrm, installing certificated remotely may not work if the operation requires a user profile. Operations on the local machine store should still work.

Actions

  • :create - creates or updates a certificate.
  • :delete - deletes a certificate.
  • :acl_add - adds read-only entries to a certificate's private key ACL.

Attribute Parameters

  • source - name attribute. The source file (for create and acl_add), thumprint (for delete and acl_add) or subject (for delete).
  • pfx_password - the password to access the source if it is a pfx file.
  • private_key_acl - array of 'domain\account' entries to be granted read-only access to the certificate's private key. This is not idempotent.
  • store_name - the certificate store to maniplate. One of MY (default : personal store), CA (trusted intermediate store) or ROOT (trusted root store).
  • user_store - if false (default) then use the local machine store; if true then use the current user's store.

Examples

# Add PFX cert to local machine personal store and grant accounts read-only access to private key
windows_certificate "c:/test/mycert.pfx" do
    pfx_password    "password"
    private_key_acl ["acme\fred", "pc\jane"]
end
# Add cert to trusted intermediate store
windows_certificate "c:/test/mycert.cer" do
    store_name  "CA"
end
# Remove all certicates matching the subject
windows_certificate "me.acme.com" do
    action :delete
end

windows_certificate_binding

Binds a certificate to an HTTP port in order to enable TLS communication.

Actions

  • :create - creates or updates a binding.
  • :delete - deletes a binding.

Attribute Parameters

  • cert_name - name attribute. The thumprint(hash) or subject that identifies the certicate to be bound.
  • name_kind - indicates the type of cert_name. One of :subject (default) or :hash.
  • address - the address to bind against. Default is 0.0.0.0 (all IP addresses).
  • port - the port to bind against. Default is 443.
  • app_id - the GUID that defines the application that owns the binding. Default is the values used by IIS.
  • store_name - the store to locate the certificate in. One of MY (default : personal store), CA (trusted intermediate store) or ROOT (trusted root store).

Examples

# Bind the first certificate matching the subject to the default TLS port
windows_certificate_binding "me.acme.com" do
end
# Bind a cert from the CA store with the given hash to port 4334
windows_certificate_binding "me.acme.com" do
    cert_name   "d234567890a23f567c901e345bc8901d34567890"
    name_kind   :hash
    store_name  "CA"
    port        4334
end

windows_feature

Windows Roles and Features can be thought of as built-in operating system packages that ship with the OS. A server role is a set of software programs that, when they are installed and properly configured, lets a computer perform a specific function for multiple users or other computers within a network. A Role can have multiple Role Services that provide functionality to the Role. Role services are software programs that provide the functionality of a role. Features are software programs that, although they are not directly parts of roles, can support or augment the functionality of one or more roles, or improve the functionality of the server, regardless of which roles are installed. Collectively we refer to all of these attributes as 'features'.

This resource allows you to manage these 'features' in an unattended, idempotent way.

There are two providers for the windows_features which map into Microsoft's two major tools for managing roles/features: Deployment Image Servicing and Management (DISM) and Servermanagercmd (The CLI for Server Manager). As Servermanagercmd is deprecated, Chef will set the default provider to Chef::Provider::WindowsFeature::DISM if DISM is present on the system being configured. The default provider will fall back to Chef::Provider::WindowsFeature::ServerManagerCmd.

For more information on Roles, Role Services and Features see the Microsoft TechNet article on the topic. For a complete list of all features that are available on a node type either of the following commands at a command prompt:

dism /online /Get-Features
servermanagercmd -query

Actions

  • :install - install a Windows role/feature
  • :remove - remove a Windows role/feature

Attribute Parameters

  • feature_name - name of the feature/role to install. The same feature may have different names depending on the provider used (ie DHCPServer vs DHCP; DNS-Server-Full-Role vs DNS).
  • all - Boolean. Optional. Default: false. DISM provider only. Forces all dependencies to be installed.
  • source - String. Optional. DISM provider only. Uses local repository for feature install.

Providers

  • Chef::Provider::WindowsFeature::DISM: Uses Deployment Image Servicing and Management (DISM) to manage roles/features.
  • Chef::Provider::WindowsFeature::ServerManagerCmd: Uses Server Manager to manage roles/features.
  • Chef::Provider::WindowsFeaturePowershell: Uses Powershell to manage roles/features. (see COOK-3714

Examples

Enable the node as a DHCP Server

windows_feature 'DHCPServer' do
  action :install
end

Enable TFTP

windows_feature 'TFTP' do
  action :install
end

Enable .Net 3.5.1 on Server 2012 using repository files on DVD and
install all dependencies

windows_feature "NetFx3" do
  action :install
  all true
  source "d:\sources\sxs"
end

Disable Telnet client/server

%w[TelnetServer TelnetClient].each do |feature|
  windows_feature feature do
    action :remove
  end
end

Add SMTP Feature with powershell provider

windows_feature "smtp-server" do
  action :install
  all true
  provider :windows_feature_powershell
end

windows_font

Installs a font.

Font files should be included in the cookbooks

Actions

  • :install - install a font to the system fonts directory.

Attribute Parameters

  • file - The name of the font file name to install. The path defaults to the files/default directory of the cookbook you're calling windows_font from. Defaults to the resource name.
  • source - Set an alternate path to the font file.

Examples

windows_font 'Code New Roman.otf'

windows_http_acl

Sets the Access Control List for an http URL to grant non-admin accounts permission to open HTTP endpoints.

Actions

  • :create - creates or updates the ACL for a URL.
  • :delete - deletes the ACL from a URL.

Attribute Parameters

  • url - the name of the url to be created/deleted.
  • user - the name (domain\user) of the user or group to be granted permission to the URL. Mandatory for create. Only one user or group can be granted permission so this replaces any previously defined entry.

Examples

windows_http_acl 'http://+:50051/' do
    user 'pc\\fred'
end
windows_http_acl 'http://+:50051/' do
    action :delete
end

windows_package

This resource is now deprecated and will be removed in a future version of this cookbook. Chef >= 12.6.0 includes a built-in package resource.

Manage Windows application packages in an unattended, idempotent way.

The following application installers are currently supported:

  • MSI packages
  • InstallShield
  • Wise InstallMaster
  • Inno Setup
  • Nullsoft Scriptable Install System

If the proper installer type is not passed into the resource's installer_type attribute, the provider will do it's best to identify the type by introspecting the installation package. If the installation type cannot be properly identified the :custom value can be passed into the installer_type attribute along with the proper flags for silent/quiet installation (using the options attribute..see example below).

PLEASE NOTE - For proper idempotence the resource's package_name should be the same as the 'DisplayName' registry value in the uninstallation data that is created during package installation. The easiest way to definitively find the proper 'DisplayName' value is to install the package on a machine and search for the uninstall information under the following registry keys:

  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall
  • HKEY_LOCAL_MACHINE\Software\Wow6464Node\Microsoft\Windows\CurrentVersion\Uninstall

For maximum flexibility the source attribute supports both remote and local installation packages.

Actions

  • :install - install a package
  • :remove - remove a package. The remove action is completely hit or miss as many application uninstallers do not support a full silent/quiet mode.

Attribute Parameters

  • package_name - name attribute. The 'DisplayName' of the application installation package.
  • source - The source of the windows installer. This can either be a URI or a local path.
  • installer_type - They type of windows installation package. Valid values include :msi, :inno, :nsis, :wise, :installshield, :custom. If this value is not provided, the provider will do it's best to identify the installer type through introspection of the file.
  • checksum - useful if source is remote, the SHA-256 checksum of the file--if the local file matches the checksum, Chef will not download it
  • options - Additional options to pass the underlying installation command
  • timeout - set a timeout for the package download (default 600 seconds)
  • version - The version number of this package, as indicated by the 'DisplayVersion' value in one of the 'Uninstall' registry keys. If the given version number does equal the 'DisplayVersion' in the registry, the package will be installed.
  • success_codes - set an array of possible successful installation return codes. Previously this was hardcoded, but certain MSIs may have a different return code, e.g. 3010 for reboot required. Must be an array, and defaults to [0, 42, 127].

Examples

Install PuTTY (InnoSetup installer)
ruby
windows_package 'PuTTY version 0.60' do
source 'http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe'
installer_type :inno
action :install
end

Install 7-Zip (MSI installer)
ruby
windows_package '7-Zip 9.20 (x64 edition)' do
source 'http://downloads.sourceforge.net/sevenzip/7z920-x64.msi'
action :install
end

Install Notepad++ (Y U No Emacs?) using a local installer
ruby
windows_package 'Notepad++' do
source 'c:/installation_files/npp.5.9.2.Installer.exe'
action :install
end

Install VLC for that Xvid (NSIS installer)
ruby
windows_package 'VLC media player 1.1.10' do
source 'http://superb-sea2.dl.sourceforge.net/project/vlc/1.1.10/win32/vlc-1.1.10-win32.exe'
action :install
end

Install Firefox as custom installer and manually set the silent install flags
ruby
windows_package 'Mozilla Firefox 5.0 (x86 en-US)' do
source 'http://archive.mozilla.org/pub/mozilla.org/mozilla.org/firefox/releases/5.0/win32/en-US/Firefox%20Setup%205.0.exe'
options '-ms'
installer_type :custom
action :install
end

Google Chrome FTW (MSI installer)
ruby
windows_package 'Google Chrome' do
source 'https://dl-ssl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B806F36C0-CB54-4A84-A3F3-0CF8A86575E0%7D%26lang%3Den%26browser%3D3%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dfalse/edgedl/chrome/install/GoogleChromeStandaloneEnterprise.msi'
action :install
end

Remove Google Chrome
ruby
windows_package 'Google Chrome' do
action :remove
end

Remove 7-Zip
ruby
windows_package '7-Zip 9.20 (x64 edition)' do
action :remove
end

windows_printer_port

Create and delete TCP/IPv4 printer ports.

Actions

  • :create - Create a TCIP/IPv4 printer port. This is the default action.
  • :delete - Delete a TCIP/IPv4 printer port

Attribute Parameters

  • ipv4_address - Name attribute. Required. IPv4 address, e.g. '10.0.24.34'
  • port_name - Port name. Optional. Defaults to 'IP_' + ipv4_address
  • port_number - Port number. Optional. Defaults to 9100.
  • port_description - Port description. Optional.
  • snmp_enabled - Boolean. Optional. Defaults to false.
  • port_protocol - Port protocol, 1 (RAW), or 2 (LPR). Optional. Defaults to 1.

Examples

Create a TCP/IP printer port named 'IP_10.4.64.37' with all defaults
ruby
windows_printer_port '10.4.64.37' do
action :create
end

Delete a printer port
ruby
windows_printer_port '10.4.64.37' do
action :delete
end

Delete a port with a custom port_name
ruby
windows_printer_port '10.4.64.38' do
port_name 'My awesome port'
action :delete
end

Create a port with more options
ruby
windows_printer_port '10.4.64.39' do
port_name 'My awesome port'
snmp_enabled true
port_protocol 2
end

windows_printer

Create Windows printer. Note that this doesn't currently install a printer
driver. You must already have the driver installed on the system.

The Windows Printer LWRP will automatically create a TCP/IP printer port for you using the ipv4_address property. If you want more granular control over the printer port, just create it using the windows_printer_port LWRP before creating the printer.

Actions

  • :create - Create a new printer
  • :delete - Delete a new printer

Attribute Parameters

  • device_id - Name attribute. Required. Printer queue name, e.g. 'HP LJ 5200 in fifth floor copy room'
  • comment - Optional string describing the printer queue.
  • default - Boolean. Optional. Defaults to false. Note that Windows sets the first printer defined to the default printer regardless of this setting.
  • driver_name - String. Required. Exact name of printer driver. Note that the printer driver must already be installed on the node.
  • location - Printer location, e.g. 'Fifth floor copy room', or 'US/NYC/Floor42/Room4207'
  • shared - Boolean. Defaults to false.
  • share_name - Printer share name.
  • ipv4_address - Printer IPv4 address, e.g. '10.4.64.23'. You don't have to be able to ping the IP addresss to set it. Required.

An error of "Set-WmiInstance : Generic failure" is most likely due to the printer driver name not matching or not being installed.

Examples

Create a printer
ruby
windows_printer 'HP LaserJet 5th Floor' do
driver_name 'HP LaserJet 4100 Series PCL6'
ipv4_address '10.4.64.38'
end

Delete a printer. Note: this doesn't delete the associated printer port. See windows_printer_port above for how to delete the port.
ruby
windows_printer 'HP LaserJet 5th Floor' do
action :delete
end

windows_reboot

This resource is now deprecated and will be removed in a future version of this cookbook. Chef >= 12.0.0 includes a built-in reboot resource.

Sets required data in the node's run_state to notify WindowsRebootHandler a reboot is requested. If Chef run completes successfully a reboot will occur if the WindowsRebootHandler is properly registered as a report handler. As an action of :request will cause a node to reboot every Chef run, this resource is usually notified by other resources...ie restart node after a package is installed (see example below).

Actions

  • :request - requests a reboot at completion of successful Cher run. requires WindowsRebootHandler to be registered as a report handler.
  • :cancel - remove reboot request from node.run_state. this will cancel ALL previously requested reboots as this is a binary state.

Attribute Parameters

  • timeout - Name attribute. timeout delay in seconds to wait before proceeding with the requested reboot. default is 60 seconds
  • reason - comment on the reason for the reboot. default is 'Chef Software Chef initiated reboot'

Examples

If the package installs, schedule a reboot at end of chef run
```ruby
windows_reboot 60 do
reason 'cause chef said so'
action :nothing
end

windows_package 'some_package' do
action :install
notifies :request, 'windows_reboot[60]'
end
```

Cancel the previously requested reboot
ruby
windows_reboot 60 do
action :cancel
end

windows_registry

This resource is now deprecated and will be removed in a future version of this cookbook. Chef >= 11.6.0 includes a built-in registry_key resource.

Creates and modifies Windows registry keys.

Change in v1.3.0: The Win32 classes use ::Win32 to avoid namespace conflict with Chef::Win32 (introduced in Chef 0.10.10).

Actions

  • :create - create a new registry key with the provided values.
  • :modify - modify an existing registry key with the provided values.
  • :force_modify - modify an existing registry key with the provided values. ensures the value is actually set by checking multiple times. useful for fighting race conditions where two processes are trying to set the same registry key. This will be updated in the near future to use 'RegNotifyChangeKeyValue' which is exposed by the WinAPI and allows a process to register for notification on a registry key change.
  • :remove - removes a value from an existing registry key

Attribute Parameters

  • key_name - name attribute. The registry key to create/modify.
  • values - hash of the values to set under the registry key. The individual hash items will become respective 'Value name' => 'Value data' items in the registry key.
  • type - Type of key to create, defaults to REG_SZ. Must be a symbol, see the overview below for valid values.

Registry key types

  • :binary - REG_BINARY
  • :string - REG_SZ
  • :multi_string - REG_MULTI_SZ
  • :expand_string - REG_EXPAND_SZ
  • :dword - REG_DWORD
  • :dword_big_endian - REG_DWORD_BIG_ENDIAN
  • :qword - REG_QWORD

Examples

Make the local windows proxy match the one set for Chef
ruby
proxy = URI.parse(Chef::Config[:http_proxy])
windows_registry 'HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings' do
values 'ProxyEnable' => 1, 'ProxyServer' => "#{proxy.host}:#{proxy.port}", 'ProxyOverride' => '<local>'
end

Enable Remote Desktop and poke the firewall hole
ruby
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server' do
values 'FdenyTSConnections' => 0
end

Delete an item from the registry
ruby
windows_registry 'HKCU\Software\Test' do
#Key is the name of the value that you want to delete the value is always empty
values 'ValueToDelete' => ''
action :remove
end

Add a REG_MULTI_SZ value to the registry
ruby
windows_registry 'HKCU\Software\Test' do
values 'MultiString' => ['line 1', 'line 2', 'line 3']
type :multi_string
end

windows_shortcut

Creates and modifies Windows shortcuts.

Actions

  • :create - create or modify a windows shortcut

Attribute Parameters

  • name - name attribute. The shortcut to create/modify.
  • target - what the shortcut links to
  • arguments - arguments to pass to the target when the shortcut is executed
  • description - description of the shortcut
  • cwd - Working directory to use when the target is executed
  • iconlocation - Icon to use, in the format of "path, index" where index is which icon in that file to use (See WshShortcut.IconLocation)

Examples

Add a shortcut all users desktop:
```ruby
require 'win32ole'
all_users_desktop = WIN32OLE.new("WScript.Shell").SpecialFolders("AllUsersDesktop")

windows_shortcut "#{all_users_desktop}/Notepad.lnk" do
target "C:\WINDOWS\notepad.exe"
description "Launch Notepad"
iconlocation "C:\windows\notepad.exe, 0"
end
```

Library Methods

Registry.value_exists?('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','BGINFO')
Registry.key_exists?('HKLM\SOFTWARE\Microsoft')
BgInfo = Registry.get_value('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run','BGINFO')

windows_path

Actions

  • :add - Add an item to the system path
  • :remove - Remove an item from the system path

Attribute Parameters

  • path - Name attribute. The name of the value to add to the system path

Examples

Add Sysinternals to the system path
ruby
windows_path 'C:\Sysinternals' do
action :add
end

Remove 7-Zip from the system path
ruby
windows_path 'C:\7-Zip' do
action :remove
end

windows_task

Creates, deletes or runs a Windows scheduled task. Requires Windows
Server 2008 due to API usage.

Actions

  • :create - creates a task (or updates existing if user or command has changed)
  • :delete - deletes a task
  • :run - runs a task
  • :end - ends a task
  • :change - changes the un/pw or command of a task
  • :enable - enable a task
  • :disable - disable a task

Attribute Parameters

  • task_name - name attribute, The task name. ("Task Name" or "/Task Name")
  • force - When used with create, will update the task.
  • command - The command the task will run.
  • cwd - The directory the task will be run from.
  • user - The user to run the task as. (defaults to 'SYSTEM')
  • password - The user's password. (requires user)
  • run_level - Run with :limited or :highest privileges.
  • frequency - Frequency with which to run the task. (default is :hourly. Other valid values include :minute, :hourly, :daily, :weekly, :monthly, :once, :on_logon, :onstart, :on_idle) *:once requires start_time
  • frequency_modifier - Multiple for frequency. (15 minutes, 2 days). Monthly tasks may also use these values": ('FIRST', 'SECOND', 'THIRD', 'FOURTH', 'LAST', 'LASTDAY')
  • start_day - Specifies the first date on which the task runs. Optional string (MM/DD/YYYY)
  • start_time - Specifies the start time to run the task. Optional string (HH:mm)
  • interactive_enabled - (Allow task to run interactively or non-interactively. Requires user and password.)
  • day - For monthly or weekly tasks, the day(s) on which the task runs. (MON - SUN, *, 1 - 31)
  • months - The Months of the year on which the task runs. (JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC, *). Multiple months should be comma delimited.
  • idle_time - For :on_idle frequency, the time (in minutes) without user activity that must pass to trigger the task. (1 - 999)

Examples

Create a chef-client task with TaskPath \ running every 15 minutes
ruby
windows_task 'chef-client' do
user 'Administrator'
password '$ecR3t'
cwd 'C:\\chef\\bin'
command 'chef-client -L C:\\tmp\\'
run_level :highest
frequency :minute
frequency_modifier 15
end

Update chef-client task with new password and log location
ruby
windows_task 'chef-client' do
user 'Administrator'
password 'N3wPassW0Rd'
cwd 'C:\\chef\\bin'
command 'chef-client -L C:\\chef\\logs\\'
action :change
end

Delete a taks 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

Disable a task named ProgramDataUpdater with TaskPath \Microsoft\Windows\Application Experience\
ruby
windows_task '\Microsoft\Windows\Application Experience\ProgramDataUpdater' do
action :disable
end

windows_zipfile

Most version of Windows do not ship with native cli utility for managing compressed files. This resource provides a pure-ruby implementation for managing zip files. Be sure to use the not_if or only_if meta parameters to guard the resource for idempotence or action will be taken every Chef run.

Actions

  • :unzip - unzip a compressed file
  • :zip - zip a directory (recursively)

Attribute Parameters

  • path - name attribute. The path where files will be (un)zipped to.
  • source - source of the zip file (either a URI or local path) for :unzip, or directory to be zipped for :zip.
  • overwrite - force an overwrite of the files if they already exist.
  • checksum - for :unzip, useful if source is remote, if the local file matches the SHA-256 checksum, Chef will not download it.

Examples

Unzip a remote zip file locally
ruby
windows_zipfile 'c:/bin' do
source 'http://download.sysinternals.com/Files/SysinternalsSuite.zip'
action :unzip
not_if {::File.exists?('c:/bin/PsExec.exe')}
end

Unzip a local zipfile
ruby
windows_zipfile 'c:/the_codez' do
source 'c:/foo/baz/the_codez.zip'
action :unzip
end

Create a local zipfile
ruby
windows_zipfile 'c:/foo/baz/the_codez.zip' do
source 'c:/the_codez'
action :zip
end

Libraries

WindowsHelper

Helper that allows you to use helpful functions in windows

installed_packages

Returns a hash of all DisplayNames installed
```ruby

usage in a recipe

::Chef::Recipe.send(:include, Windows::Helper)
hash_of_installed_packages = installed_packages
```

is_package_installed?

  • package_name - The name of the package you want to query to see if it is installed
  • returns - true if the package is installed, false if it the package is not installed

Download a file if a package isn't installed
```ruby

usage in a recipe to not download a file if package is already installed

::Chef::Recipe.send(:include, Windows::Helper)
is_win_sdk_installed = is_package_installed?('Windows Software Development Kit')

remote_file 'C:\windows\temp\windows_sdk.zip' do
source 'http://url_to_download/windows_sdk.zip'
action :create_if_missing
not_if {is_win_sdk_installed}
end

Do something if a package is installed
ruby

usage in a provider

include Windows::Helper
if is_package_installed?('Windows Software Development Kit')
# do something if package is installed
end
```

Exception/Report Handlers

WindowsRebootHandler

Required reboots are a necessary evil of configuring and managing Windows nodes. This report handler (ie fires at the end of Chef runs) acts on requested (Chef initiated) or pending (as determined by the OS per configuration action we performed) reboots. The allow_pending_reboots initialization argument should be set to false if you do not want the handler to automatically reboot a node if it has been determined a reboot is pending. Reboots can still be requested explicitly via the windows_reboot LWRP.

Initialization Arguments

  • allow_pending_reboots - indicator on whether the handler should act on a the Window's 'pending reboot' state. default is true
  • timeout - timeout delay in seconds to wait before proceeding with the reboot. default is 60 seconds
  • reason - comment on the reason for the reboot. default is 'Chef Software Chef initiated reboot'

Windows ChefSpec Matchers

The Windows cookbook includes custom ChefSpec matchers you can use to test your own cookbooks that consume Windows cookbook LWRPs.

Example Matcher Usage

expect(chef_run).to install_windows_package('Node.js').with(
  source: 'http://nodejs.org/dist/v0.10.26/x64/node-v0.10.26-x64.msi')

Windows Cookbook Matchers

  • install_windows_package
  • remove_windows_package
  • install_windows_feature
  • remove_windows_feature
  • delete_windows_feature
  • create_windows_task
  • disable_windows_task
  • enable_windows_task
  • delete_windows_task
  • run_windows_task
  • change_windows_task
  • add_windows_path
  • remove_windows_path
  • run_windows_batch
  • set_windows_pagefile
  • unzip_windows_zipfile_to
  • zip_windows_zipfile_to
  • create_windows_shortcut
  • create_windows_auto_run
  • remove_windows_auto_run
  • create_windows_printer
  • delete_windows_printer
  • create_windows_printer_port
  • delete_windows_printer_port
  • request_windows_reboot
  • cancel_windows_reboot
  • create_windows_shortcut

Usage

Place an explicit dependency on this cookbook (using depends in the cookbook's metadata.rb) from any cookbook where you would like to use the Windows-specific resources/providers that ship with this cookbook.

depends 'windows'

default

Convenience recipe that installs supporting gems for many of the resources/providers that ship with this cookbook.

reboot_handler

Leverages the chef_handler LWRP to register the WindowsRebootHandler report handler that ships as part of this cookbook. By default this handler is set to automatically act on pending reboots. If you would like to change this behavior override node['windows']['allow_pending_reboots'] and set the value to false. For example:

name 'base'
description 'base role'
override_attributes(
  'windows' => {
    'allow_pending_reboots' => false
  }
)

This will still allow a reboot to be explicitly requested via the windows_reboot LWRP.

By default, the handler will only be registered as a report handler, meaning that it will only fire at the end of successful Chef runs. If the run fails, pending or requested reboots will be ignored. This can lead to a situation where some package was installed and notified a reboot request via the windows_reboot LWRP, and then the run fails for some unrelated reason, and the reboot request gets dropped because the resource that notified the reboot request will already be up-to-date at the next run and will not request a reboot again, and thus the requested reboot will never be performed. To change this behavior and register the handler as an exception handler that fires at the end of failed runs too, override node['windows']['allow_reboot_on_failure'] and set the value to true.

License & Authors

Copyright 2011-2015, Chef Software, Inc.
Copyright 2010, VMware, Inc.
Copyright 2011, Business Intelligence Associates, Inc
Copyright 2012, Nordstrom, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

chef_handler >= 0.0.0

Contingent cookbooks

7-zip Applicable Versions
AWS_ms_dotnet Applicable Versions
Notepadplus_2 Applicable Versions
PsTools Applicable Versions
PsTools 1.20160904.2
PsTools 1.20160904.3
PsTools 1.20160904.4
PsTools 1.20160904.5
PsTools 1.20160904.6
PsTools 1.20160904.7
PsTools 1.20160904.8
PsTools 1.20160907.1
PsTools 1.20160910.1
PsTools 1.20160910.2
PsTools 1.20160911.1
PsTools 1.20160920.1
PsTools 1.20161023.1
PsTools 1.20161023.2
PsTools 1.20161103.1
PsTools 1.20161103.2
PsTools 1.20161104.1
PsTools 1.20161106.1
PsTools 1.20161112.2
PsTools 1.20161112.3
PsTools 1.20161113.1
PsTools 1.20161118.1
PsTools 1.20161118.2
PsTools 1.20161120.1
PsTools 1.20161120.2
PsTools 1.20161122.1
PsTools 1.20161122.2
PsTools 1.20161122.3
PsTools 1.20161122.4
PsTools 1.20161123.1
PsTools 1.20161123.2
PsTools 1.20161123.3
PsTools 1.20161123.4
PsTools 1.20161123.5
PsTools 1.20161123.6
PsTools 1.20161123.7
PsTools 1.20161123.8
PsTools 1.20161123.9
PsTools 1.20161123.10
PsTools 1.20161124.1
PsTools 1.20161126.1
PsTools 1.20161126.2
PsTools 1.20161126.3
PsTools 1.20161127.1
PsTools 1.20161127.2
PsTools 1.20161127.3
PsTools 1.20161130.1
PsTools 1.20161130.2
PsTools 1.20161201.1
PsTools 1.20161202.1
PsTools 1.20161202.2
PsTools 1.20161202.3
PsTools 1.20161202.4
PsTools 1.20161203.1
PsTools 1.20161203.2
PsTools 1.20161203.3
PsTools 1.20161204.1
PsTools 1.20170204.3
PsTools 1.20170205.1
PsTools 1.20170224.1
PsTools 1.20170224.2
PsTools 1.20170304.1
PsTools 1.20170304.2
PsTools 1.20170304.3
PsTools 1.20170305.1
PsTools 1.20170313.1
PsTools 1.20170313.2
PsTools 1.20170314.1
PsTools 1.20170314.2
PsTools 1.20170314.3
PsTools 1.20170314.4
PsTools 1.20170314.5
PsTools 1.20170315.1
PsTools 1.20170315.2
PsTools 1.20170321.1
PsTools 1.20170321.2
PsTools 1.20170321.3
PsTools 1.20170324.1
PsTools 1.20170324.2
PsTools 1.20170325.1
PsTools 1.20170325.2
PsTools 1.20170325.3
PsTools 1.20170327.1
PsTools 1.20170327.2
PsTools 1.20170327.3
PsTools 1.20170408.1
PsTools 1.20170409.1
PsTools 1.20170409.2
PsTools 1.20170409.3
PsTools 1.20170409.4
PsTools 1.20170409.5
PsTools 1.20170409.6
PsTools 1.20170409.7
PsTools 1.20170411.1
PsTools 1.20170422.1
PsTools 1.20170423.1
PsTools 1.20170423.2
PsTools 1.20170517.1
PsTools 1.20170527.1
PsTools 1.20170527.2
PsTools 1.20170527.3
PsTools 1.20170527.4
PsTools 1.20170527.5
PsTools 1.20170527.6
SysinternalsBginfo Applicable Versions
ad-join Applicable Versions
air Applicable Versions
apache2-windows Applicable Versions
appveyor Applicable Versions
appveyor-ci Applicable Versions
appveyorapi Applicable Versions
arcgis-desktop Applicable Versions
arcgis-enterprise Applicable Versions
arcgis-pro Applicable Versions
ark Applicable Versions
artifact Applicable Versions
artifact_legacy Applicable Versions
auditbeat Applicable Versions
autohotkey Applicable Versions
aws-ec2-snapshot Applicable Versions
b1 Applicable Versions
bacula-backup Applicable Versions
bacula-client Applicable Versions
beyondcompare Applicable Versions
bginfo Applicable Versions
box-sync Applicable Versions
buildkite Applicable Versions
cafe Applicable Versions
certificate_services Applicable Versions
chef-client Applicable Versions
chef-splunk-windows Applicable Versions
chef-waiter Applicable Versions
chefdk_bootstrap Applicable Versions
chocolatey Applicable Versions
chocolatey-installer Applicable Versions
chrome Applicable Versions
chromedriver Applicable Versions
composer Applicable Versions
consul Applicable Versions
couchbase Applicable Versions
couchbase-ng Applicable Versions
cygwin Applicable Versions
dacpac Applicable Versions
database_upgrader Applicable Versions
datadog Applicable Versions
divvy Applicable Versions
dmi Applicable Versions
dotnetframework Applicable Versions
dropbox Applicable Versions
drupal-windows Applicable Versions
dsc2 Applicable Versions
ec2configservice Applicable Versions
esri-iis Applicable Versions
expect Applicable Versions
fiddler Applicable Versions
filebeat Applicable Versions
filezilla Applicable Versions
firefox Applicable Versions
firefox_package Applicable Versions
flash Applicable Versions
flyway-cli Applicable Versions
gauge Applicable Versions
ghostdriver Applicable Versions
gimp Applicable Versions
git Applicable Versions
git-extensions Applicable Versions
gocd Applicable Versions
google-drive Applicable Versions
gow Applicable Versions
grant_logon_as_service Applicable Versions
graphite_powershell_functions Applicable Versions
habitat Applicable Versions
hana-studio Applicable Versions
heidisql Applicable Versions
hipchat_client Applicable Versions
iedriver Applicable Versions
iis Applicable Versions
iis-lb Applicable Versions
iis-packages-server Applicable Versions
iis_urlrewrite Applicable Versions
java Applicable Versions
java-snapshot Applicable Versions
kindle Applicable Versions
kms-server Applicable Versions
komodo-edit Applicable Versions
libsodium Applicable Versions
ls_windows_ad Applicable Versions
maven Applicable Versions
mercurial Applicable Versions
metricbeat Applicable Versions
mod_security Applicable Versions
mozilla_firefox Applicable Versions
ms_dotnet Applicable Versions
ms_dotnet2 Applicable Versions
ms_dotnet35 Applicable Versions
ms_dotnet4 Applicable Versions
ms_dotnet45 Applicable Versions
ms_messagequeue Applicable Versions
ms_telnet_client Applicable Versions
msoffice Applicable Versions
mssqlserver Applicable Versions
mssqlserver 1.20161122.4
mssqlserver 1.20161123.1
mssqlserver 1.20161123.2
mssqlserver 1.20161123.3
mssqlserver 1.20161123.4
mssqlserver 1.20161123.5
mssqlserver 1.20161123.6
mssqlserver 1.20161123.7
mssqlserver 1.20161123.8
mssqlserver 1.20161123.9
mssqlserver 1.20161123.10
mssqlserver 1.20161124.1
mssqlserver 1.20161126.1
mssqlserver 1.20161126.2
mssqlserver 1.20161126.3
mssqlserver 1.20161127.1
mssqlserver 1.20161127.2
mssqlserver 1.20161127.3
mssqlserver 1.20161130.1
mssqlserver 1.20161130.2
mssqlserver 1.20161201.1
mssqlserver 1.20161202.1
mssqlserver 1.20161202.2
mssqlserver 1.20161202.3
mssqlserver 1.20161202.4
mssqlserver 1.20161203.1
mssqlserver 1.20161203.2
mssqlserver 1.20161203.3
mssqlserver 1.20161204.1
mssqlserver 1.20170204.3
mssqlserver 1.20170205.1
mssqlserver 1.20170224.1
mssqlserver 1.20170224.2
mssqlserver 1.20170304.1
mssqlserver 1.20170304.2
mssqlserver 1.20170304.3
mssqlserver 1.20170305.1
mssqlserver 1.20170313.1
mssqlserver 1.20170313.2
mssqlserver 1.20170314.1
mssqlserver 1.20170314.2
mssqlserver 1.20170314.3
mssqlserver 1.20170314.4
mssqlserver 1.20170314.5
mssqlserver 1.20170315.1
mssqlserver 1.20170315.2
mssqlserver 1.20170321.2
mssqlserver 1.20170321.3
mssqlserver 1.20170324.1
mssqlserver 1.20170324.2
mssqlserver 1.20170325.1
mssqlserver 1.20170325.2
mssqlserver 1.20170325.3
mssqlserver 1.20170327.1
mssqlserver 1.20170327.2
mssqlserver 1.20170327.3
mssqlserver 1.20170408.1
mssqlserver 1.20170409.1
mssqlserver 1.20170409.2
mssqlserver 1.20170409.3
mssqlserver 1.20170409.4
mssqlserver 1.20170409.5
mssqlserver 1.20170409.6
mssqlserver 1.20170409.7
mssqlserver 1.20170411.1
mssqlserver 1.20170422.1
mssqlserver 1.20170423.1
mssqlserver 1.20170423.2
mssqlserver 1.20170517.1
mssqlserver 1.20170527.1
mssqlserver 1.20170527.2
mssqlserver 1.20170527.3
mssqlserver 1.20170527.4
mssqlserver 1.20170527.5
mssqlserver 1.20170527.6
mssqlserver 1.20170527.7
mssqlserver 1.20170527.8
mssqlserver 1.20180204.1
mssqlserver 1.20180204.2
mysql Applicable Versions
mysql-windows Applicable Versions
nant Applicable Versions
nexpose Applicable Versions
nodejs-windows Applicable Versions
nopcommerce Applicable Versions
notepadplusplus Applicable Versions
notepadplusplus_2 Applicable Versions
notepadpp Applicable Versions
nssm Applicable Versions
ntp Applicable Versions
octopus Applicable Versions
octopus-deploy Applicable Versions
omnibus Applicable Versions
openbazaar Applicable Versions
openssh-win Applicable Versions
operadriver Applicable Versions
opsview_client Applicable Versions
opsworks_ruby Applicable Versions
paintdotnet Applicable Versions
pandoc Applicable Versions
perforce Applicable Versions
perl Applicable Versions
php Applicable Versions
plex-home-theater Applicable Versions
powergui Applicable Versions
powershell Applicable Versions
private-internet-access Applicable Versions
proget Applicable Versions
push-jobs Applicable Versions
putty Applicable Versions
pycharm-community-edition Applicable Versions
resharper Applicable Versions
rubyinstaller Applicable Versions
sbp_emet Applicable Versions
sbp_mcafee Applicable Versions
sbp_messageanalyzer Applicable Versions
sbp_mremoteng Applicable Versions
sbp_netmon Applicable Versions
sbp_safenet Applicable Versions
sbp_sysinternals Applicable Versions
sbp_tcp_offloading Applicable Versions
sbp_tortoisegit Applicable Versions
sbp_treesizefree Applicable Versions
selenium Applicable Versions
selenium_grid Applicable Versions
sensu Applicable Versions
seven_zip Applicable Versions
signalfx_agent Applicable Versions
sikulix Applicable Versions
sitecore Applicable Versions
skype-app Applicable Versions
skype_windows Applicable Versions
snapraid Applicable Versions
spotify Applicable Versions
sql_server Applicable Versions
sqlce Applicable Versions
steam Applicable Versions
stegosoc-windows Applicable Versions
subversion Applicable Versions
symantec Applicable Versions
sysmon Applicable Versions
telegraf Applicable Versions
tfs Applicable Versions
tfs 1.20160723.8
tfs 1.20160723.9
tfs 1.20160723.10
tfs 1.20160723.11
tfs 1.20160724.1
tfs 1.20160731.1
tfs 1.20160801.1
tfs 1.20160802.1
tfs 1.20160824.1
tfs 1.20160825.1
tfs 1.20160825.2
tfs 1.20160826.1
tfs 1.20160826.2
tfs 1.20160826.3
tfs 1.20160826.4
tfs 1.20160826.5
tfs 1.20160826.6
tfs 1.20160826.7
tfs 1.20160826.8
tfs 1.20160826.9
tfs 1.20160826.10
tfs 1.20160827.1
tfs 1.20160828.1
tfs 1.20160828.2
tfs 1.20160828.3
tfs 1.20160828.4
tfs 1.20160828.5
tfs 1.20160828.6
tfs 1.20160828.7
tfs 1.20160828.8
tfs 1.20160830.1
tfs 1.20160830.2
tfs 1.20160831.1
tfs 1.20160831.2
tfs 1.20160831.3
tfs 1.20160831.4
tfs 1.20160831.5
tfs 1.20160831.6
tfs 1.20160831.7
tfs 1.20160831.8
tfs 1.20160831.9
tfs 1.20160831.10
tfs 1.20160831.11
tfs 1.20160903.1
tfs 1.20160903.2
tfs 1.20160903.3
tfs 1.20160903.4
tfs 1.20160903.5
tfs 1.20160903.6
tfs 1.20160903.7
tfs 1.20160903.8
tfs 1.20160904.1
tfs 1.20160904.2
tfs 1.20160904.3
tfs 1.20160904.4
tfs 1.20160904.5
tfs 1.20160904.6
tfs 1.20160904.7
tfs 1.20160904.8
tfs 1.20160907.1
tfs 1.20160910.1
tfs 1.20160910.2
tfs 1.20160911.1
tfs 1.20160920.1
tfs 1.20161023.1
tfs 1.20161023.2
tfs 1.20161103.1
tfs 1.20161103.2
tfs 1.20161104.1
tfs 1.20161106.1
tfs 1.20161112.2
tfs 1.20161112.3
tfs 1.20161113.1
tfs 1.20161118.1
tfs 1.20161118.2
tfs 1.20161120.1
tfs 1.20161120.2
tfs 1.20161122.1
tfs 1.20161122.2
tfs 1.20161122.3
tfs 1.20161122.4
tfs 1.20161123.1
tfs 1.20161123.2
tfs 1.20161123.3
tfs 1.20161123.4
tfs 1.20161123.5
tfs 1.20161123.6
tfs 1.20161123.7
tfs 1.20161123.8
tfs 1.20161123.9
tfs 1.20161123.10
tfs 1.20161124.1
tfs 1.20161126.1
tfs 1.20161126.2
tfs 1.20161126.3
tfs 1.20161127.1
tfs 1.20161127.2
tfs 1.20161127.3
tfs 1.20161130.1
tfs 1.20161130.2
tfs 1.20161201.1
tfs 1.20161202.1
tfs 1.20161202.2
tfs 1.20161202.3
tfs 1.20161202.4
tfs 1.20161203.1
tfs 1.20161203.2
tfs 1.20161203.3
tfs 1.20161204.1
tfs 1.20170204.3
tfs 1.20170205.1
tfs 1.20170224.1
tfs 1.20170224.2
tfs 1.20170304.1
tfs 1.20170304.2
tfs 1.20170304.3
tfs 1.20170305.1
tfs 1.20170313.1
tfs 1.20170313.2
tfs 1.20170314.1
tfs 1.20170314.2
tfs 1.20170314.3
tfs 1.20170314.4
tfs 1.20170314.5
tfs 1.20170315.1
tfs 1.20170315.2
tfs 1.20170321.1
tfs 1.20170321.2
tfs 1.20170321.3
tfs 1.20170324.1
tfs 1.20170324.2
tfs 1.20170325.1
tfs 1.20170325.2
tfs 1.20170325.3
tfs 1.20170327.1
tfs 1.20170327.2
tfs 1.20170327.3
tfs 1.20170408.1
tfs 1.20170409.1
tfs 1.20170409.2
tfs 1.20170409.3
tfs 1.20170409.4
tfs 1.20170409.5
tfs 1.20170409.6
tfs 1.20170409.7
tfs 1.20170411.1
tfs 1.20170422.1
tfs 1.20170423.1
tfs 1.20170423.2
tfs 1.20170517.1
tfs 1.20170527.1
tfs 1.20170527.2
tfs 1.20170527.3
tfs 1.20170527.4
tfs 1.20170527.5
tfs 1.20170527.6
tissues Applicable Versions
topbeat Applicable Versions
tripwire_agent Applicable Versions
vagrant Applicable Versions
vc2010 Applicable Versions
vc2013 Applicable Versions
vcruntime Applicable Versions
veeam Applicable Versions
vim-windows Applicable Versions
virtualbox Applicable Versions
virtualbox-install Applicable Versions
visualstudio Applicable Versions
vlc Applicable Versions
vmware_workstation Applicable Versions
vs-2008 Applicable Versions
vsts_agent Applicable Versions
vsts_build_agent Applicable Versions
webhook Applicable Versions
webpi Applicable Versions
win_dns Applicable Versions
win_firewall Applicable Versions
win_time Applicable Versions
winbox Applicable Versions
windev Applicable Versions
windirstat Applicable Versions
windows-hostname Applicable Versions
windows_ad Applicable Versions
windows_dfs Applicable Versions
windows_dhcp Applicable Versions
windows_dns Applicable Versions
windows_failover_cluster Applicable Versions
windows_print Applicable Versions
windows_ssl Applicable Versions
windows_tasks Applicable Versions
winlogbeat_lwrp Applicable Versions
winlogbeats Applicable Versions
winrm Applicable Versions
winrm-config Applicable Versions
winscp Applicable Versions
wireshark Applicable Versions
wix Applicable Versions
wordpress-windows Applicable Versions
wsus-server Applicable Versions
x2go-client Applicable Versions
zabbix2 Applicable Versions

windows Cookbook CHANGELOG

This file is used to list changes made in each version of the windows cookbook.

v1.43.0

  • PR 369 - Add a enable_windows_task matcher

v1.42.0

  • PR 365 - Escape command quotes when passing to schtasks

v1.41.0

  • PR 364 - Configurable font source

v1.40.0

  • PR 357 - Fixes for schtasks
  • PR 359 - take bundler out of the appveyor build
  • PR 356 - Misc fixes and updates
  • PR 355 - bump and pin rubocop, fix broken cop
  • PR 348 - Make notify work for windows_task

v1.39.2

  • PR 329 - Silence compile_time warning for chef_gem
  • PR 338 - ChefSpec matchers for windows_certificate
  • PR 341 - Updated rubocop and FoodCritic compliance
  • PR 336 - Fixed where clause compliance with PS v1/v2

v1.39.1

  • PR 325 - Raise an error if a bogus feature is given to the powershell windows_feature provider
  • PR 326 - Fix windows_font and copy the font file before installation

v1.39.0

  • PR 305 - Added months attribute to windows_task and allow frequency_modifier to accept values 'FIRST', 'SECOND', 'THIRD', 'FOURTH', 'LAST', and 'LASTDAY' for monthly frequency
  • PR 310 - Fix windows_task breaks when there is a space in the user name
  • PR 314 - fixes reboot handling on some chef versions below 11.12
  • PR 317 - Adds a disable_windows_task matcher
  • PR 311 - Implements the cwd attribute of windows_task
  • PR 318 - Use dsl instead of manual resource instanciation
  • PR 303 - Fix http_acl idempotency when user name contains a space
  • PR 257 - Speed up windows_feature dism provider
  • PR 319 - Add a .kitchen.cloud.yml for kitchen testing on Azure
  • PR 315 - Deprecate windows_package and forward to Chef::Provider::Package::Windows when running 12.6 or higher

v1.38.4

  • PR 295 - Escape http_acl username
  • PR 293 - Separating assignments to code_script and guard_script as they should be different scripts and not hold the same reference
  • Issue 298 - windows_certificate_binding is ignoring store_name attribute and always saving to MY
  • Issue 296 - Fixes windows_certificate idempotentcy on chef 11 clients

v1.38.3

  • Make windows_task resource idempotent (double quotes need to be single when comparing)
  • Issue 245 - Fix No resource, method, or local variable namedpassword' for Chef::Provider::WindowsTask' when interactive_enabled is true

v1.38.2

  • Lazy-load windows-pr gem library files. Chef 12.5 no longer includes the windows-pr gem. Earlier versions of this cookbook will not compile on Chef 12.5.

v1.38.1 (2015-07-28)

  • Publishing without extended metadata

v1.38.0 (2015-07-27)

  • Do not set new_resource.password to nil, Fixes #219, Fixes #220
  • Add windows_certificate resource #212
  • Add windows_http_acl resource #214

v1.37.0 (2015-05-14)

  • fix windows_package Chef.set_resource_priority_array warning
  • update windows_task to support tasks in folders
  • fix windows_task delete action
  • replace windows_task name attribute with 'task_name'
  • add :end action to 'windows_task'
  • Tasks created with the windows_task resource default to the SYSTEM account
  • The force attribute for windows_task makes the :create action update the definition.
  • windows_task :create action will force an update of the task if the user or command differs from the currently configured setting.
  • add default provider for windows_feature
  • add a helper to make sure WindowsRebootHandler works in ChefSpec
  • added a source and issues url to the metadata for Supermarket
  • updated the Gemfile and .kitchen.yml to reflect the latest test-kitchen windows guest support
  • started tests using the kitchen-pester verifier

v1.36.6 (2014-12-18)

  • reverting all chef_gem compile_time work

v1.36.5 (2014-12-18)

  • Fix zipfile provider

v1.36.4 (2014-12-18)

  • Fix Chef chef_gem with Chef::Resource::ChefGem.method_defined?(:compile_time)

v1.36.3 (2014-12-18)

  • Fix Chef chef_gem below 12.1.0

v1.36.2 (2014-12-17)

  • Being explicit about usage of the chef_gem's compile_time property.
  • Eliminating future deprecation warnings in Chef 12.1.0

v1.36.1 (2014-12-17)

  • PR 160 - Fix Chef 11.10 / versions without windows_package in core

v1.36.0 (2014-12-16)

  • PR 145 - do not fail on non-existant task
  • PR 144 - Add a zip example to the README
  • PR 110 - More zip documentation
  • PR 148 - Add an LWRP for font installation
  • PR 151 - Fix windows_package on Chef 12, add integration tests
  • PR 129 - Add enable/disable actions to task LWRP
  • PR 115 - require Chef::Mixin::PowershellOut before using it
  • PR 88 - Code 1003 from servermanagercmd.exe is valid

v1.34.8 (2014-10-31)

  • Issue 137 - windows_path resource breaks with ruby 2.x

v1.34.6 (2014-09-22)

v1.34.2 (2014-08-12)

  • Issue 99 - Remove rubygems / Internet wmi-lite dependency (PR #108)

v1.34.0 (2014-08-04)

  • Issue 99 - Use wmi-lite to fix Chef 11.14.2 break in rdp-ruby-wmi dependency

v1.32.1 (2014-07-15)

  • Fixes broken cookbook release

v1.32.0 (2014-07-11)

  • Add ChefSpec resource methods to allow notification testing (@sneal)
  • Add use_inline_resources to providers (@micgo)
  • [COOK-4728] - Allow reboot handler to be used as an exception handler
  • [COOK-4620] - Ensure win_friendly_path doesn't error out when ALT_SEPARATOR is nil

v1.31.0 (2014-05-07)

  • [COOK-2934] - Add windows_feature support for 2 new DISM attributes: all, source

v1.30.2 (2014-04-02)

  • [COOK-4414] - Adding ChefSpec matchers

v1.30.0 (2014-02-14)

  • [COOK-3715] - Unable to create a startup task with no login
  • [COOK-4188] - Add powershell_version method to return Powershell version

v1.12.8 (2014-01-21)

  • [COOK-3988] Don't unescape URI before constructing it.

v1.12.6 (2014-01-03)

  • [COOK-4168] Circular dep on powershell - moving powershell libraries into windows. removing dependency on powershell

v1.12.4

Fixing depend/depends typo in metadata.rb

v1.12.2

Bug

  • COOK-4110 - feature_servermanager installed? method regex bug

v1.12.0

Bug

  • COOK-3793 - parens inside parens of README.md don't render

New Feature

  • COOK-3714 - Powershell features provider and delete support.

v1.11.0

Improvement

  • COOK-3724 - Rrecommend built-in resources over cookbook resources
  • COOK-3515 - Remove unprofessional comment from library
  • COOK-3455 - Add Windows Server 2012R2 to windows cookbook version helper

Bug

  • COOK-3542 - Fix an issue where windows_zipfile fails with LoadError
  • COOK-3447 - Allow Overriding Of The Default Reboot Timeout In windows_reboot_handler
  • COOK-3382 - Allow windows_task to create on_logon tasks
  • COOK-2098 - Fix and issue where the windows_reboot handler is ignoring the reboot time

New Feature

  • COOK-3458 - Add support for start_date and start_time in windows_task

v1.10.0

Improvement

  • [COOK-3126]: windows_task should support the on start frequency
  • [COOK-3127]: Support the force option on task create and delete

v1.9.0

Bug

  • [COOK-2899]: windows_feature fails when a feature install requires a reboot
  • [COOK-2914]: Foodcritic failures in Cookbooks
  • [COOK-2983]: windows cookbook has foodcritic failures

Improvement

  • [COOK-2686]: Add Windows Server 2012 to version.rb so other depending chef scripts can detect Windows Server 2012

v1.8.10

When using Windows qualified filepaths (C:/foo), the #absolute? method
for URI returns true, because "C" is the scheme.

This change checks that the URI is http or https scheme, so it can be
passed off to remote_file appropriately.

  • [COOK-2729] - allow only http, https URI schemes

v1.8.8

  • [COOK-2729] - helper should use URI rather than regex and bare string

v1.8.6

  • [COOK-968] - windows_package provider should gracefully handle paths with spaces
  • [COOK-222] - windows_task resource does not declare :change action
  • [COOK-241] - Windows cookbook should check for redefined constants
  • [COOK-248] - Windows package install type is case sensitive

v1.8.4

  • [COOK-2336] - MSI That requires reboot returns with RC 3010 and causes chef run failure
  • [COOK-2368] - version attribute of the windows_package provider should be documented

v1.8.2

Important: Use powershell in nodes expanded run lists to ensure
powershell is downloaded, as powershell has a dependency on this
cookbook; v1.8.0 created a circular dependency.

  • [COOK-2301] - windows 1.8.0 has circular dependency on powershell

v1.8.0

  • [COOK-2126] - Add checksum attribute to windows_zipfile
  • [COOK-2142] - Add printer and printer_port LWRPs
  • [COOK-2149] - Chef::Log.debug Windows Package command line
  • [COOK-2155] -windows_package does not send checksum to cached_file in installer_type

v1.7.0

  • [COOK-1745] - allow for newer versions of rubyzip

v1.6.0

  • [COOK-2048] - undefined method for Falseclass on task :change when action is :nothing (and task doesn't exist)
  • [COOK-2049] - Add windows_pagefile resource

v1.5.0

  • [COOK-1251] - Fix LWRP "NotImplementedError"
  • [COOK-1921] - Task LWRP will return true for resource exists when no other scheduled tasks exist
  • [COOK-1932] - Include :change functionality to windows task lwrp

v1.4.0:

  • [COOK-1571] - windows_package resource (with msi provider) does not accept spaces in filename
  • [COOK-1581] - Windows cookbook needs a scheduled tasks LWRP
  • [COOK-1584] - windows_registry should support all registry types

v1.3.4

  • [COOK-1173] - windows_registry throws Win32::Registry::Error for action :remove on a nonexistent key
  • [COOK-1182] - windows package sets start window title instead of quoting a path
  • [COOK-1476] - zipfile lwrp should support :zip action
  • [COOK-1485] - package resource fails to perform install correctly when "source" contains quote
  • [COOK-1519] - add action :remove for path lwrp

v1.3.2

  • [COOK-1033] - remove the libraries/ruby_19_patches.rb file which causes havoc on non-Windows systems.
  • [COOK-811] - add a timeout parameter attribute for windows_package

v1.3.0

  • [COOK-1323] - Update for changes in Chef 0.10.10.
    • Setting file mode doesn't make sense on Windows (package provider
    • and reboot_handler recipe)
    • Prefix ::Win32 to avoid namespace collision with Chef::Win32
    • (registry_helper library)
    • Use chef_gem instead of gem_package so gems get installed correctly under the Ruby environment Chef runs in (reboot_handler recipe, zipfile provider)

v1.2.12

  • [COOK-1037] - specify version for rubyzip gem
  • [COOK-1007] - windows_feature does not work to remove features with dism
  • [COOK-667] - shortcut resource + provider for Windows platforms

v1.2.10

  • [COOK-939] - add type parameter to windows_registry to allow binary registry keys.
  • [COOK-940] - refactor logic so multiple values get created.

v1.2.8

  • FIX: Older Windows (Windows Server 2003) sometimes return 127 on successful forked commands
  • FIX: windows_package, ensure we pass the WOW* registry redirection flags into reg.open

v1.2.6

  • patch to fix [CHEF-2684], Open4 is named Open3 in Ruby 1.9
  • Ruby 1.9's Open3 returns 0 and 42 for successful commands
  • retry keyword can only be used in a rescue block in Ruby 1.9

v1.2.4

  • windows_package - catch Win32::Registry::Error that pops up when searching certain keys

v1.2.2

  • combined numerous helper libarires for easier sharing across libaries/LWRPs
  • renamed Chef::Provider::WindowsFeature::Base file to the more descriptive feature_base.rb
  • refactored windows_path LWRP
    • :add action should MODIFY the the underlying ENV variable (vs CREATE)
    • deleted greedy :remove action until it could be made more idempotent
  • added a windows_batch resource/provider for running batch scripts remotely

v1.2.0

  • [COOK-745] gracefully handle required server restarts on Windows platform
    • WindowsRebootHandler for requested and pending reboots
    • windows_reboot LWRP for requesting (receiving notifies) reboots
    • reboot_handler recipe for enabling WindowsRebootHandler as a report handler
  • [COOK-714] Correct initialize misspelling
  • RegistryHelper - new get_values method which returns all values for a particular key.

v1.0.8

  • [COOK-719] resource/provider for managing windows features
  • [COOK-717] remove windows_env_vars resource as env resource exists in core chef
  • new Windows::Version helper class
  • refactored Windows::Helper mixin

v1.0.6

  • added force_modify action to windows_registry resource
  • add win_friendly_path helper
  • re-purpose default recipe to install useful supporting windows related gems

v1.0.4

  • [COOK-700] new resources and improvements to the windows_registry provider (thanks Paul Morton!)
    • Open the registry in the bitednes of the OS
    • Provide convenience methods to check if keys and values exit
    • Provide convenience method for reading registry values
    • NEW - windows_auto_run resource/provider
    • NEW - windows_env_vars resource/provider
    • NEW - windows_path resource/provider
  • re-write of the windows_package logic for determining current installed packages
  • new checksum attribute for windows_package resource...useful for remote packages

v1.0.2

  • [COOK-647] account for Wow6432Node registry redirecter
  • [COOK-656] begin/rescue on win32/registry

v1.0.0

  • [COOK-612] initial release

Foodcritic Metric
            

1.43.0 failed this metric

FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/223bf70d86b5ab73596ae8ff/windows/providers/feature_servermanagercmd.rb:30
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/223bf70d86b5ab73596ae8ff/windows/providers/feature_servermanagercmd.rb:33
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/223bf70d86b5ab73596ae8ff/windows/providers/reboot.rb:23
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/223bf70d86b5ab73596ae8ff/windows/providers/reboot.rb:24
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/223bf70d86b5ab73596ae8ff/windows/providers/reboot.rb:25