summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/resource/windows_feature_powershell.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/resource/windows_feature_powershell.rb b/lib/chef/resource/windows_feature_powershell.rb
index 048c67229c..a0bb82e868 100644
--- a/lib/chef/resource/windows_feature_powershell.rb
+++ b/lib/chef/resource/windows_feature_powershell.rb
@@ -142,10 +142,10 @@ class Chef
# @return [Array] features the user has requested to install which need installation
def features_to_install
# the intersection of the features to install & disabled/removed features are what needs installing
- if new_resource.source && node["powershell_features_cache"]["removed"]
- @install ||= new_resource.feature_name & ( node["powershell_features_cache"]["disabled"] | node["powershell_features_cache"]["removed"] )
- else
- @install ||= new_resource.feature_name & node["powershell_features_cache"]["disabled"]
+ @features_to_install ||= begin
+ features = node["powershell_features_cache"]["disabled"]
+ features |= node["powershell_features_cache"]["removed"] if new_resource.source
+ new_resource.feature_name & features
end
end