summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-04 19:18:32 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-20 14:38:03 -0700
commit6ffe92446118a9c56e793f42158f35d423d081a7 (patch)
tree897563ba2a509af1a2dbf297727751ec1c396cb7 /lib/chef/mixin
parent377ec3040dd3ec2b4fc4b4e66d5ca71ab79dd1b7 (diff)
downloadchef-6ffe92446118a9c56e793f42158f35d423d081a7.tar.gz
Update PowershelTypeCoercions to call to_psobject
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/powershell_type_coercions.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chef/mixin/powershell_type_coercions.rb b/lib/chef/mixin/powershell_type_coercions.rb
index 580288c3a0..c5c035bb7c 100644
--- a/lib/chef/mixin/powershell_type_coercions.rb
+++ b/lib/chef/mixin/powershell_type_coercions.rb
@@ -39,13 +39,16 @@ class Chef
def translate_type(value)
translation = type_coercions[value.class]
- should_quote = true
translated_value = nil
if translation
should_quote = translation[:single_quoted]
translated_value = translation[:type].call(value)
+ elsif value.respond_to? :to_psobject
+ should_quote = false
+ translated_value = "(#{value.to_psobject})"
else
+ should_quote = true
translated_value = value.to_s
end