summaryrefslogtreecommitdiff
path: root/lib/chef/util/powershell/cmdlet.rb
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-10 13:22:31 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-20 14:38:01 -0700
commitf235a6e5e41f3d8c53d872aac4e4bd928b812dff (patch)
tree34cc406af7284d51e22ced2095832151e787c1b5 /lib/chef/util/powershell/cmdlet.rb
parentbd4250090372c101bd1fb21dc7c8abffdf50756c (diff)
downloadchef-f235a6e5e41f3d8c53d872aac4e4bd928b812dff.tar.gz
Break super long string up onto multiple lines
Diffstat (limited to 'lib/chef/util/powershell/cmdlet.rb')
-rw-r--r--lib/chef/util/powershell/cmdlet.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/util/powershell/cmdlet.rb b/lib/chef/util/powershell/cmdlet.rb
index 40edbb13c6..4ad3656b57 100644
--- a/lib/chef/util/powershell/cmdlet.rb
+++ b/lib/chef/util/powershell/cmdlet.rb
@@ -57,7 +57,10 @@ class Chef::Util::Powershell
end
json_command = @json_format ? " | convertto-json -compress -depth #{json_depth}" : ""
- command_string = "powershell.exe -executionpolicy bypass -noprofile -noninteractive -command \"trap [Exception] {write-error -exception ($_.Exception.Message);exit 1};#{@cmdlet} #{switches_string} #{arguments_string}#{json_command}\";if ( ! $? ) { exit 1 }"
+ command_string = "powershell.exe -executionpolicy bypass -noprofile -noninteractive "\
+ "-command \"trap [Exception] {write-error -exception "\
+ "($_.Exception.Message);exit 1};#{@cmdlet} #{switches_string} "\
+ "#{arguments_string}#{json_command}\";if ( ! $? ) { exit 1 }"
augmented_options = {:returns => [0], :live_stream => false}.merge(execution_options)
command = Mixlib::ShellOut.new(command_string, augmented_options)
@@ -133,4 +136,3 @@ class Chef::Util::Powershell
end
end
end
-