Class: Chef::Pwsh
- Inherits:
-
PowerShell
- Object
- PowerShell
- Chef::Pwsh
- Defined in:
- lib/chef/pwsh.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(script, timeout: -1)) ⇒ Object
constructor
Run a command under pwsh (powershell core) via FFI This implementation requires the managed dll, native wrapper and a published, self contained dotnet core directory tree to exist in the bindir directory.
Constructor Details
#initialize(script, timeout: -1)) ⇒ Object
Run a command under pwsh (powershell core) via FFI This implementation requires the managed dll, native wrapper and a published, self contained dotnet core directory tree to exist in the bindir directory.
29 30 31 32 |
# File 'lib/chef/pwsh.rb', line 29 def initialize(script, timeout: -1) @dll = Pwsh.dll super end |
Class Method Details
.dll ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/chef/pwsh.rb', line 61 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. # 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.dll").last end |