summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-08-17 22:25:25 -0700
committerGitHub <noreply@github.com>2020-08-17 22:25:25 -0700
commitdae6eb27b8ca6f2c6e00c8bf11babf2302d59b63 (patch)
tree5aa00979e5a8392512aa0f66ce0cd087e8ad8dfd /lib
parent0cbd5cb3b4891c087cfda6ea69e539c0f041ab39 (diff)
parentb464890d6a717c488c3f7ad83e0ff06034278627 (diff)
downloadchef-dae6eb27b8ca6f2c6e00c8bf11babf2302d59b63.tar.gz
Merge pull request #10315 from chef/win_feature
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/windows_feature_powershell.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_feature_powershell.rb b/lib/chef/resource/windows_feature_powershell.rb
index 6e4e0e5ff5..0fcd52241a 100644
--- a/lib/chef/resource/windows_feature_powershell.rb
+++ b/lib/chef/resource/windows_feature_powershell.rb
@@ -163,8 +163,12 @@ 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 features are what needs installing
- @install ||= new_resource.feature_name & node["powershell_features_cache"]["disabled"]
+ # the intersection of the features to install & disabled/removed features are what needs installing
+ @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
# @return [Array] features the user has requested to remove which need removing