diff options
author | mwrock <matt@mattwrock.com> | 2020-11-13 11:09:44 -0800 |
---|---|---|
committer | mwrock <matt@mattwrock.com> | 2020-11-13 11:09:44 -0800 |
commit | 74ef923ee6a619c1298718a526ded55098012c70 (patch) | |
tree | 38f268d383d4bf94128fc4bb8ecc6be69e71147c /lib/chef/powershell.rb | |
parent | 3020773f943536e59a98a2fa72823288825ef9c6 (diff) | |
download | chef-resolver.tar.gz |
pull in v0.2.1 of powershell shim that fixes .net resolverresolver
Signed-off-by: mwrock <matt@mattwrock.com>
Diffstat (limited to 'lib/chef/powershell.rb')
-rw-r--r-- | lib/chef/powershell.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/chef/powershell.rb b/lib/chef/powershell.rb index 4800708dfc..905b92ebfb 100644 --- a/lib/chef/powershell.rb +++ b/lib/chef/powershell.rb @@ -63,15 +63,7 @@ class Chef def exec(script) FFI.ffi_lib @dll FFI.attach_function :execute_powershell, :ExecuteScript, [:string], :pointer - # This is a temporary fix for running in a Habitat environment - # In habitat we set CHEF_POWERSHELL_BIN so that .Net resolves our - # managed shim assembly from the correct location. - # It seems that that is preventing .Net from successfully loading GAC assemblies - # and can break all sorts of edge (and not so edge) scenarios. Once we are actually - # inside the powershell run space, we know our shim was loaded and can unset - # CHEF_POWERSHELL_BIN which will bypass our custom resolver logic. The real fix is - # to fix our resolver. Oh and OH MY GOD this was a pain to track down. - execution = FFI.execute_powershell("$ENV:CHEF_POWERSHELL_BIN=$NULL;#{script}").read_utf16string + execution = FFI.execute_powershell(script).read_utf16string hashed_outcome = Chef::JSONCompat.parse(execution) @result = Chef::JSONCompat.parse(hashed_outcome["result"]) @errors = hashed_outcome["errors"] |