summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormwrock <matt@mattwrock.com>2020-11-17 13:08:59 -0800
committermwrock <matt@mattwrock.com>2020-11-17 13:08:59 -0800
commitbd6dc3c8eadb23713a4d50ef6284a08563b25a60 (patch)
tree07615f51d7047cedab386f86a2e2be89fb1b5764 /lib
parent225268c1a4697b06d067420d69b3def1ea48b092 (diff)
downloadchef-bd6dc3c8eadb23713a4d50ef6284a08563b25a60.tar.gz
update pwsh in powershell_exec to 7.1.0 and add comments explaining how to pull in updatesps71
Signed-off-by: mwrock <matt@mattwrock.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/powershell.rb5
-rw-r--r--lib/chef/pwsh.rb7
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/chef/powershell.rb b/lib/chef/powershell.rb
index 905b92ebfb..6b925eabb6 100644
--- a/lib/chef/powershell.rb
+++ b/lib/chef/powershell.rb
@@ -34,6 +34,11 @@ class Chef
# @param script [String] script to run
# @return [Object] output
def initialize(script)
+ # This Powershell DLL source lives here: https://github.com/chef/chef-powershell-shim
+ # Every merge into that repo triggers a Habitat build and promotion. Running
+ # the rake :update_chef_exec_dll task in this (chef/chef) repo will pull down
+ # the built packages and copy the binaries to distro/ruby_bin_folder. Bundle install
+ # ensures that the correct architecture binaries are installed into the path.
@dll ||= "Chef.PowerShell.Wrapper.dll"
exec(script)
end
diff --git a/lib/chef/pwsh.rb b/lib/chef/pwsh.rb
index cbb8d6a8b9..3d067eb0d6 100644
--- a/lib/chef/pwsh.rb
+++ b/lib/chef/pwsh.rb
@@ -58,6 +58,13 @@ class Chef
end
def self.dll
+ # This Powershell DLL source lives here: https://github.com/chef/chef-powershell-shim
+ # Every merge into that repo triggers a Habitat build and promotion. Running
+ # the rake :update_chef_exec_dll task in this (chef/chef) repo will pull down
+ # the built packages and copy the binaries to distro/ruby_bin_folder. Bundle install
+ # ensures that the correct architecture binaries are installed into the path.
+ # Also note that the version of pwsh is determined by which assemblies the dll was
+ # built with. To update powershell, those dependencies must be bumped.
@dll ||= Dir.glob("#{RbConfig::CONFIG["bindir"]}/**/Chef.PowerShell.Wrapper.Core.dll").last
end
end