diff options
-rw-r--r-- | lib/chef/resource/windows_feature_powershell.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/resource/windows_feature_powershell.rb b/lib/chef/resource/windows_feature_powershell.rb index 829f07317b..048c67229c 100644 --- a/lib/chef/resource/windows_feature_powershell.rb +++ b/lib/chef/resource/windows_feature_powershell.rb @@ -142,7 +142,11 @@ 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 - @install ||= new_resource.feature_name & ( node["powershell_features_cache"]["disabled"] | node["powershell_features_cache"]["removed"] ) + 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"] + end end # @return [Array] features the user has requested to remove which need removing |