winrm-elevated 1.1.1 → 1.1.2
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 +4 -4
- data/lib/winrm-elevated/scripts/elevated_shell.ps1 +1 -1
- data/lib/winrm/shells/elevated.rb +9 -4
- metadata +18 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f2b2fca8293f26ddc26ca6f68a1d2b69ced5ef8be217aed74600e2acb2857ba
|
|
4
|
+
data.tar.gz: acb00e26cab830dac9e99243b45cd2540862126cbc36fea58b291622c013e266
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 |
|
|
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 '
|
|
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([
|
|
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
|
-
|
|
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.
|
|
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:
|
|
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.
|
|
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.
|
|
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
|