Skip to main content

PowershellCookbookHelpers

The department is: PowershellCookbookHelpers

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

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

Use node['powershell']['version'] or the new powershell_version helper available in Chef Infra Client 15.8+ instead of the deprecated PowerShell cookbook helpers

Examples

incorrect

Powershell::VersionHelper.powershell_version?('4.0')

correct

node['powershell']['version'].to_f == 4.0

# better (Chef Infra Client 15.8+)
powershell_version == 4.0

Configurable attributes

NameDefault valueConfigurable values
Version Added6.1.0String
Include
    Array

    Was this page helpful?

    ×









    Search Results