winrm-elevated 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/changelog.md +3 -0
- data/lib/winrm-elevated/runner.rb +2 -1
- data/lib/winrm-elevated/scripts/elevated_shell.ps1 +5 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b63f3710673e9e412c7110b790d0faa0d31acb81
|
4
|
+
data.tar.gz: 6345755c43570c6850cc6f2ead751a223e78c3df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 761a06ccc981cf532c8b6985d6a7536c54412d9f98e63fbd10f3f0b4974a53552074f2e25f70e60911776793b65fb476be821e991d5cec90f9e96f2e89c0ab6d
|
7
|
+
data.tar.gz: 78176a4a5d945b910854129b99e5934ecf7c141642b5317f01560addc40d55e6b047648fd657796af57532f22048a4e4159497416c4685c734a8ee471bb44d45
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/changelog.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# WinRM-Elevated Gem Changelog
|
2
2
|
|
3
|
+
# 0.3.0
|
4
|
+
- [Name Powershell Script and Log Files Uniquely](https://github.com/WinRb/winrm-elevated/pull/6)
|
5
|
+
|
3
6
|
# 0.2.0
|
4
7
|
- [Only upload the elevated runner script once per winrm session](https://github.com/WinRb/winrm-elevated/pull/3)
|
5
8
|
- Bump WinRM (1.5) and WinRM-fs (0.3.0) gem constraints
|
@@ -16,6 +16,7 @@
|
|
16
16
|
|
17
17
|
require 'winrm'
|
18
18
|
require 'winrm-fs'
|
19
|
+
require 'securerandom'
|
19
20
|
|
20
21
|
module WinRM
|
21
22
|
module Elevated
|
@@ -26,7 +27,7 @@ module WinRM
|
|
26
27
|
def initialize(winrm_service)
|
27
28
|
@winrm_service = winrm_service
|
28
29
|
@winrm_file_manager = WinRM::FS::FileManager.new(winrm_service)
|
29
|
-
@elevated_shell_path = 'c:/windows/temp/winrm-elevated-shell.ps1'
|
30
|
+
@elevated_shell_path = 'c:/windows/temp/winrm-elevated-shell-' + SecureRandom.uuid + '.ps1'
|
30
31
|
@uploaded = nil
|
31
32
|
end
|
32
33
|
|
@@ -1,15 +1,8 @@
|
|
1
1
|
param([String]$username, [String]$password, [String]$encoded_command, [String]$timeout)
|
2
2
|
|
3
3
|
$task_name = "WinRM_Elevated_Shell"
|
4
|
-
$out_file =
|
5
|
-
$err_file =
|
6
|
-
|
7
|
-
if (Test-Path $out_file) {
|
8
|
-
del $out_file
|
9
|
-
}
|
10
|
-
if (Test-Path $err_file) {
|
11
|
-
del $err_file
|
12
|
-
}
|
4
|
+
$out_file = [System.IO.Path]::GetTempFileName()
|
5
|
+
$err_file = [System.IO.Path]::GetTempFileName()
|
13
6
|
|
14
7
|
$task_xml = @'
|
15
8
|
<?xml version="1.0" encoding="UTF-16"?>
|
@@ -94,6 +87,9 @@ do {
|
|
94
87
|
$err_cur_line = SlurpOutput $err_file $err_cur_line 'err'
|
95
88
|
} while (!($registered_task.state -eq 3))
|
96
89
|
|
90
|
+
del $out_file
|
91
|
+
del $err_file
|
92
|
+
|
97
93
|
$exit_code = $registered_task.LastTaskResult
|
98
94
|
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($schedule) | Out-Null
|
99
95
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: winrm-elevated
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shawn Neal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: winrm
|