summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKapil Chouhan <kapil.chouhan@msystechnologies.com>2019-05-08 16:36:59 +0530
committerTim Smith <tsmith@chef.io>2019-05-08 22:40:49 -0700
commiteb223872fd5259f4856d1bbb88e5ece5280b462f (patch)
treee039308b7b60e4e275c0b63ebb6d380a3f0216c1
parent7576b2e32a58668eed0ddf2d687e82651d46db04 (diff)
downloadchef-fix_win_feature.tar.gz
Fix for chef 14 windows_feature fails on windows 2008r2fix_win_feature
Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
-rw-r--r--lib/chef/resource/windows_feature_powershell.rb2
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