diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-04 19:18:32 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-20 14:38:03 -0700 |
commit | 6ffe92446118a9c56e793f42158f35d423d081a7 (patch) | |
tree | 897563ba2a509af1a2dbf297727751ec1c396cb7 /lib/chef/mixin | |
parent | 377ec3040dd3ec2b4fc4b4e66d5ca71ab79dd1b7 (diff) | |
download | chef-6ffe92446118a9c56e793f42158f35d423d081a7.tar.gz |
Update PowershelTypeCoercions to call to_psobject
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r-- | lib/chef/mixin/powershell_type_coercions.rb | 5 |
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 |