Skip to main content

WindowsVersionHelpers

All Cookstyle Cops


The department is: Chef/Deprecations

The full name of the cop is: Chef/Deprecations/WindowsVersionHelpers


Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYes14.0+

Use node[‘platform_version’] and node[‘kernel’] data instead of the deprecated Windows::VersionHelper helpers from the Windows cookbook.

Examples

incorrect

Windows::VersionHelper.nt_version
Windows::VersionHelper.server_version?
Windows::VersionHelper.core_version?
Windows::VersionHelper.workstation_version?

correct

node['platform_version'].to_f
node['kernel']['product_type'] == 'Server'
node['kernel']['server_core']
node['kernel']['product_type'] == 'Workstation'

Configurable attributes

NameDefault valueConfigurable values
Version Added5.4.0String
Exclude
  • **/metadata.rb
  • **/Berksfile
Array

Was this page helpful?









Search Results