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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5dd2aedaa29f5db9d7c76317297e2f780738dda
4
- data.tar.gz: 30026cd65516506dd0039a02905b28dcb84277d0
3
+ metadata.gz: b1051d65b4fb7fb6111e7f5f1751934ef5d491c6
4
+ data.tar.gz: 606787eebba3404fddc2bc847bd9097121da4717
5
5
  SHA512:
6
- metadata.gz: 36e6054a95058dad980e5e2aecceebb41a1ca937580c6a9a50e3aa6f039d07451f1015abc5805afee2c7ac5b77c1961e6bc2f9437997bf70012462dd2fd7fa75
7
- data.tar.gz: bcdbdb898e9ce29ae422a4441887a44f1c8bec4871b86f752ea59098d39b0d6a56c786838ffc384ad37ac15fc0f4f5b2c681710941b45fcbe9fbf5ca6957e0b8
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
- STDERR.print stderr
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
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module WinrmCli
3
- VERSION = '1.0.7'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-winrmcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Cameron Ryan