chef-powershell 3.0.15 → 3.0.16
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.
Potentially problematic release.
This version of chef-powershell might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bin/ruby_bin_folder/AMD64/Chef.PowerShell.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/Chef.Powershell.Wrapper.dll +0 -0
- data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
- data/lib/chef-powershell/powershell.rb +11 -14
- data/lib/chef-powershell/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d7e92fc5253d76e76722d2b7c0131366b74f658ea9686c34a8f1f3453b777a8
|
4
|
+
data.tar.gz: 502b236084d361134678d75dacaecd287d5cc15549426697882824834dbbae49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 954bba18993c2e6fa1061ab0c0d32799d6d8e5f7c260d05e5e7bc6c31384699103e64d9c899f13f90ff357a3523697047f86b552459abad792b4e1b9edebd50f
|
7
|
+
data.tar.gz: 0e7f20fe60e61fe4e5433cacd24439675872a9bbec181b1f3eeab7e284a207e85cc4fb983cef08902c9d3abf9692cf030d663091e000239c66e04ccbb77b82bd
|
Binary file
|
Binary file
|
data/bin/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll
CHANGED
Binary file
|
@@ -66,16 +66,13 @@ class ChefPowerShell
|
|
66
66
|
module PowerMod
|
67
67
|
extend FFI::Library
|
68
68
|
|
69
|
-
def self.
|
70
|
-
@
|
71
|
-
|
72
|
-
|
73
|
-
def self.powershell_dll
|
74
|
-
@powershell_dll
|
69
|
+
def self.load_powershell_dll(powershell_dll)
|
70
|
+
@dlls ||= []
|
71
|
+
return if @dlls.include?(powershell_dll)
|
72
|
+
@dlls << powershell_dll
|
75
73
|
end
|
76
74
|
|
77
75
|
def self.do_work(ps_command, timeout = -1)
|
78
|
-
ffi_lib PowerMod.powershell_dll
|
79
76
|
attach_function :execute_powershell, :ExecuteScript, %i{string int}, :pointer
|
80
77
|
execute_powershell(ps_command, timeout)
|
81
78
|
end
|
@@ -84,13 +81,13 @@ class ChefPowerShell
|
|
84
81
|
private
|
85
82
|
|
86
83
|
def exec(script, timeout: -1)
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
@result = FFI_Yajl::Parser.parse(
|
92
|
-
@errors =
|
93
|
-
@verbose =
|
84
|
+
load_powershell_dll(@powershell_dll)
|
85
|
+
execution = PowerMod.do_work(script, timeout)
|
86
|
+
output = execution.read_utf16string
|
87
|
+
hashed_outcome = FFI_Yajl::Parser.parse(output)
|
88
|
+
@result = FFI_Yajl::Parser.parse(hashed_outcome["result"])
|
89
|
+
@errors = hashed_outcome["errors"]
|
90
|
+
@verbose = hashed_outcome["verbose"]
|
94
91
|
end
|
95
92
|
end
|
96
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-powershell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|