Skip to main content

Chef/Deprecations/WindowsVersionHelpers

Cookstyle cops page

The Cookstyle cops department: Chef/Deprecations

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
Include
    Array

    Thank you for your feedback!

    ×