vagrant-winrmcli 1.0.7 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant-winrmcli/command.rb +14 -1
- data/lib/vagrant-winrmcli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1051d65b4fb7fb6111e7f5f1751934ef5d491c6
|
4
|
+
data.tar.gz: 606787eebba3404fddc2bc847bd9097121da4717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29c8da2a56b87785b901f866b2f9986c9db954aba6c15185cdba71767741aaa75a62fc8b47f46536a454bca30173471f85e93abf3a31cb402470bbc5c98042f0
|
7
|
+
data.tar.gz: 0a99d7be553c4c485f9571511daeae017da039ebd6a20ceb64272e6e9dbcd367e685746362c5421fe1f9d9923a847faeea6abd862607160eef14af3560e4ba5a
|
@@ -41,7 +41,12 @@ module VagrantPlugins
|
|
41
41
|
while true do
|
42
42
|
cmd = @env.ui.ask mode == 'ps' ? "PS> " : "CMD> "
|
43
43
|
cmd = cmd.strip
|
44
|
+
if cmd.empty?
|
45
|
+
next
|
46
|
+
end
|
47
|
+
|
44
48
|
if mode == 'ps'
|
49
|
+
cmd = '$tcd=[Environment]::GetEnvironmentVariable("TuskCd","User");if($tcd){cd $tcd;};function Set-Location {$r=iex ("Microsoft.PowerShell.Management\Set-Location " + $args -join " ");[Environment]::SetEnvironmentVariable("TuskCd",(gl),"User");$r} ' + cmd
|
45
50
|
encoded_script = cmd.encode('UTF-16LE', 'UTF-8')
|
46
51
|
script = Base64.strict_encode64(encoded_script)
|
47
52
|
cmd = "powershell -encodedCommand #{script}"
|
@@ -51,9 +56,17 @@ module VagrantPlugins
|
|
51
56
|
silence_warnings do
|
52
57
|
command_id = winrm.run_command(shell_id, cmd)
|
53
58
|
end
|
59
|
+
isclixml = false
|
54
60
|
winrm.get_command_output(shell_id, command_id) do |stdout, stderr|
|
55
61
|
STDOUT.print stdout
|
56
|
-
|
62
|
+
if !stderr.nil? and (isclixml or stderr.include? 'CLIXML')
|
63
|
+
isclixml = true
|
64
|
+
stderr.scan(/<S S="Error">(.*?)<\/S>/).each { |x|
|
65
|
+
STDERR.print x[0].gsub('_x000D__x000A_', "\n")
|
66
|
+
}
|
67
|
+
else
|
68
|
+
STDERR.print stderr
|
69
|
+
end
|
57
70
|
end
|
58
71
|
winrm.cleanup_command(shell_id, command_id)
|
59
72
|
end
|