diff options
author | Tim Smith <tsmith@chef.io> | 2019-05-10 17:49:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 17:49:22 -0700 |
commit | 7ec03e91bdd3853767b25a2dce8afb7b1154bb3e (patch) | |
tree | e039308b7b60e4e275c0b63ebb6d380a3f0216c1 | |
parent | 7576b2e32a58668eed0ddf2d687e82651d46db04 (diff) | |
parent | eb223872fd5259f4856d1bbb88e5ece5280b462f (diff) | |
download | chef-7ec03e91bdd3853767b25a2dce8afb7b1154bb3e.tar.gz |
Merge pull request #8510 from chef/fix_win_feature
windows_feature: Fix failures on windows 2008r2
-rw-r--r-- | lib/chef/resource/windows_feature_powershell.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/windows_feature_powershell.rb b/lib/chef/resource/windows_feature_powershell.rb index a0d4c1ae64..be6e3dfba1 100644 --- a/lib/chef/resource/windows_feature_powershell.rb +++ b/lib/chef/resource/windows_feature_powershell.rb @@ -226,7 +226,7 @@ class Chef # Grab raw feature information from dism command line # Windows < 2012 doesn't present a state value so we have to check if the feature is installed or not raw_list_of_features = if older_than_win_2012_or_8? # make the older format look like the new format, warts and all - powershell_out!('Get-WindowsFeature | Select-Object -Property Name, @{Name=\"InstallState\"; Expression = {If ($_.Installed) { 1 } Else { 0 }}} | ConvertTo-Json -Compress', timeout: new_resource.timeout).stdout + powershell_out!('Get-WindowsFeature | Select-Object -Property Name, @{Name="InstallState"; Expression = {If ($_.Installed) { 1 } Else { 0 }}} | ConvertTo-Json -Compress', timeout: new_resource.timeout).stdout else powershell_out!("Get-WindowsFeature | Select-Object -Property Name,InstallState | ConvertTo-Json -Compress", timeout: new_resource.timeout).stdout end |