winrm-elevated 1.1.1 → 1.1.2

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
  SHA256:
3
- metadata.gz: e4eafa3868086d590ce41b1b34631f82a2830d62ce635423cc17a7137ee82fe1
4
- data.tar.gz: 9e673bfbbbf91f8c3595b4ad2680d61bc12fe423bf2ff65c0a47196459fd9a12
3
+ metadata.gz: 4f2b2fca8293f26ddc26ca6f68a1d2b69ced5ef8be217aed74600e2acb2857ba
4
+ data.tar.gz: acb00e26cab830dac9e99243b45cd2540862126cbc36fea58b291622c013e266
5
5
  SHA512:
6
- metadata.gz: 15871834756bd792d2df264a426d8f3c4aa76cb083a279beeabccf8ffe2693413910ac59447dba6639201904bd5cd03e8b2ce4adb9263a27aab9a20b84bab56e
7
- data.tar.gz: 7648a7e4337a7b7f89e082725a96e1fe7764e5923053b18b4cb13b9eb62f378f1fd9b8db147c84b122e41b26a1ab988940c5cef567a26fbbfc054890170d9566
6
+ metadata.gz: f65ffee1e0df126f9a4c68477213a527c29bf5c7c220adae4dd49bb09c6d2270086a48833f532e4a320d05d0019a3968fedac2e5fa0c673962131694a053a97a
7
+ data.tar.gz: 51de3fab0da1486447b18c3996f7ec10640d1e9113142ccbb965da7a33c4b749d76b5965a4c1503bda11e52414d93c6f166399b156120bc141e344372bdc569d
@@ -83,7 +83,7 @@ while ( (!($registered_task.state -eq 4)) -and ($sec -lt $timeout) ) {
83
83
 
84
84
  function SlurpOutput($file, $cur_line, $out_type) {
85
85
  if (Test-Path $file) {
86
- get-content $file | select -skip $cur_line | ForEach {
86
+ get-content $file | Select-Object -skip $cur_line | ForEach-Object {
87
87
  $cur_line += 1
88
88
  if ($out_type -eq 'err') {
89
89
  $host.ui.WriteErrorLine("$_")
@@ -13,7 +13,7 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- require 'erubis'
16
+ require 'erubi'
17
17
  require 'winrm'
18
18
  require 'winrm-fs'
19
19
  require 'securerandom'
@@ -75,7 +75,7 @@ module WinRM
75
75
  end
76
76
 
77
77
  def with_temp_file(script_text)
78
- file = Tempfile.new(['winrm-elevated-shell', 'ps1'])
78
+ file = Tempfile.new(%w[winrm-elevated-shell ps1])
79
79
  file.write(script_text)
80
80
  file.write("\r\n$Host.SetShouldExit($LASTEXITCODE)")
81
81
  file.fsync
@@ -91,12 +91,17 @@ module WinRM
91
91
  end
92
92
 
93
93
  def wrap_in_scheduled_task(script_path, username, password)
94
- Erubis::Eruby.new(elevated_shell_script_content).result(
94
+ context = {
95
95
  username: username,
96
96
  password: password,
97
97
  script_path: script_path,
98
98
  interactive_logon: interactive_logon
99
- )
99
+ }
100
+
101
+ b = binding
102
+ locals = context.collect { |k, _| "#{k} = context[#{k.inspect}]; " }
103
+ b.eval(locals.join)
104
+ b.eval(Erubi::Engine.new(elevated_shell_script_content).src)
100
105
  end
101
106
  end
102
107
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winrm-elevated
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Neal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2019-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: erubi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.8'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: winrm
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -113,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
127
  requirements:
114
128
  - - ">="
115
129
  - !ruby/object:Gem::Version
116
- version: 2.2.0
130
+ version: 2.3.0
117
131
  required_rubygems_version: !ruby/object:Gem::Requirement
118
132
  requirements:
119
133
  - - ">="
@@ -121,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
135
  version: '0'
122
136
  requirements: []
123
137
  rubyforge_project:
124
- rubygems_version: 2.7.6
138
+ rubygems_version: 2.7.8
125
139
  signing_key:
126
140
  specification_version: 4
127
141
  summary: Ruby library for running commands as elevated