summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKapil Chouhan <kapil.chouhan@msystechnologies.com>2019-05-08 16:36:59 +0530
committerKapil Chouhan <kapil.chouhan@msystechnologies.com>2019-05-08 16:36:59 +0530
commit0c0af747b18a1a9c8f9cfcf5e1711ba483df0b97 (patch)
tree92674b0be0e9e6c11aac6fa46691b520bd5e9f1f
parenta0a0b02ce7d4a96fdaffa1762a6669afd6b60858 (diff)
downloadchef-0c0af747b18a1a9c8f9cfcf5e1711ba483df0b97.tar.gz
Fix for chef 14 windows_feature fails on windows 2008r2
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