summaryrefslogtreecommitdiff
path: root/lib/chef/util/powershell/cmdlet.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/util/powershell/cmdlet.rb')
-rw-r--r--lib/chef/util/powershell/cmdlet.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/util/powershell/cmdlet.rb b/lib/chef/util/powershell/cmdlet.rb
index 6ab380c071..e300266b1e 100644
--- a/lib/chef/util/powershell/cmdlet.rb
+++ b/lib/chef/util/powershell/cmdlet.rb
@@ -62,8 +62,11 @@ class Chef
json_depth = @output_format_options[:depth]
end
- json_command = @json_format ? " | convertto-json -compress -depth #{json_depth} "\
- "> #{streams[:json].path}" : ""
+ json_command = if @json_format
+ " | convertto-json -compress -depth #{json_depth} > #{streams[:json].path}"
+ else
+ ""
+ end
redirections = "4> '#{streams[:verbose].path}'"
command_string = "powershell.exe -executionpolicy bypass -noprofile -noninteractive "\
"-command \"trap [Exception] {write-error -exception "\