winrm 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8513f8bd7975beaf571799996f1a2a799d5f9703
4
- data.tar.gz: 18d6d880eb43e8038048e587ce4530472a09798f
3
+ metadata.gz: cdb9bfd4d44bdc3e671be670a00a0a56a26d0225
4
+ data.tar.gz: 6f8dee428dbe911d59815d82c8cb26860047b3f6
5
5
  SHA512:
6
- metadata.gz: d71061fcb4154162b517fead0f4392d0e012494e5fe506aa7c712beab933a45ac8f90e154e028f2f50166bcec9cf19245422f30f66c8081adc923455595db4d6
7
- data.tar.gz: 15ea773970783c2fdcf4cd1220d057c4cbee4a66d998e00ff444b2c9002cceb38aeff61b3f442b2a2ad753fed169559547592a382a1f89e0096b37ec2829d0d0
6
+ metadata.gz: a0d1bd52c2fa18fd41959bbf03ecc2d5c2339cb33efc651d1adb707bb813aa7ff4f7cc1c539d08f2379629ecad95d43d87a96351512896f6798bf921b2e0e117
7
+ data.tar.gz: 0f3bb047858ca2e1f3c8810f9073323c9d2daf67d05647d992a33b285e666d2e187620afaf8775cd0eadc9e5d7d187b10e4d921ac213426149e6c72ee938ad39
@@ -1,5 +1,8 @@
1
1
  # WinRM Gem Changelog
2
2
 
3
+ # 2.0.3
4
+ - Do not swallow exit codes from executables
5
+
3
6
  # 2.0.2
4
7
  - Constrain to rubyntlm `>= 0.6.1` to avoid mutating frozen strings
5
8
  - When using certificate authentication, do not validate presense of user and password
@@ -98,6 +98,7 @@ module WinRM
98
98
 
99
99
  def send_command(command, _arguments)
100
100
  command_id = SecureRandom.uuid.to_s.upcase
101
+ command += "\r\nif (!$?) { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }"
101
102
  message = PSRP::MessageFactory.create_pipeline_message(@runspace_id, command_id, command)
102
103
  fragmenter.fragment(message) do |fragment|
103
104
  command_args = [connection_opts, shell_id, command_id, fragment]
@@ -3,5 +3,5 @@
3
3
  # WinRM module
4
4
  module WinRM
5
5
  # The version of the WinRM library
6
- VERSION = '2.0.2'.freeze
6
+ VERSION = '2.0.3'.freeze
7
7
  end
@@ -13,6 +13,11 @@ describe 'winrm client powershell' do
13
13
  it { should have_no_stderr }
14
14
  end
15
15
 
16
+ describe 'ipconfig with invalid args' do
17
+ subject(:output) { @powershell.run('ipconfig blah') }
18
+ it { should have_exit_code 1 }
19
+ end
20
+
16
21
  describe 'throw' do
17
22
  subject(:output) { @powershell.run("throw 'an error occured'") }
18
23
  it { should have_exit_code 0 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winrm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Wanek
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-15 00:00:00.000000000 Z
12
+ date: 2016-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gssapi