Merge branch 'master' of https://github.com/matthewcodes/vagrant into matthewcodes-master
This commit is contained in:
commit
d657804f18
|
@ -218,10 +218,10 @@ module VagrantPlugins
|
||||||
wrapped_encoded_command = Base64.strict_encode64(
|
wrapped_encoded_command = Base64.strict_encode64(
|
||||||
"$ProgressPreference='SilentlyContinue'; #{command}; exit $LASTEXITCODE".encode('UTF-16LE', 'UTF-8'))
|
"$ProgressPreference='SilentlyContinue'; #{command}; exit $LASTEXITCODE".encode('UTF-16LE', 'UTF-8'))
|
||||||
|
|
||||||
"powershell -executionpolicy bypass -file \"#{guest_script_path}\" " +
|
"powershell -executionpolicy bypass -file '#{guest_script_path}' " +
|
||||||
"-username \"#{shell.username}\" -password \"#{shell.password}\" " +
|
"-username '#{shell.username}' -password '#{shell.password}' " +
|
||||||
"-encoded_command \"#{wrapped_encoded_command}\" " +
|
"-encoded_command '#{wrapped_encoded_command}' " +
|
||||||
"-execution_time_limit \"#{shell.execution_time_limit}\""
|
"-execution_time_limit '#{shell.execution_time_limit}'"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Handles the raw WinRM shell result and converts it to a
|
# Handles the raw WinRM shell result and converts it to a
|
||||||
|
|
|
@ -89,7 +89,8 @@ describe VagrantPlugins::CommunicatorWinRM::Communicator do
|
||||||
expect(shell).to receive(:upload).with(kind_of(String), "c:/tmp/vagrant-elevated-shell.ps1")
|
expect(shell).to receive(:upload).with(kind_of(String), "c:/tmp/vagrant-elevated-shell.ps1")
|
||||||
expect(shell).to receive(:powershell) do |cmd|
|
expect(shell).to receive(:powershell) do |cmd|
|
||||||
expect(cmd).to eq("powershell -executionpolicy bypass -file \"c:/tmp/vagrant-elevated-shell.ps1\" " +
|
expect(cmd).to eq("powershell -executionpolicy bypass -file \"c:/tmp/vagrant-elevated-shell.ps1\" " +
|
||||||
"-username \"vagrant\" -password \"password\" -encoded_command \"JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsAIABkAGkAcgA7ACAAZQB4AGkAdAAgACQATABBAFMAVABFAFgASQBUAEMATwBEAEUA\" -execution_time_limit \"PT2H\"")
|
"-username 'vagrant' -password 'password' -encoded_command 'JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsAIABkAGkAcgA7ACAAZQB4AGkAdAAgACQATABBAFMAVABFAFgASQBUAEMATwBEAEUA' -execution_time_limit 'PT2H'")
|
||||||
|
>>>>>>> cbb03a02d4b42e350ed92f73ced05f3046100ae8
|
||||||
end.and_return({ exitcode: 0 })
|
end.and_return({ exitcode: 0 })
|
||||||
expect(subject.execute("dir", { elevated: true })).to eq(0)
|
expect(subject.execute("dir", { elevated: true })).to eq(0)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue