Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of pwshlib for executing powershell commands #94

Open
brajjan opened this issue Oct 31, 2023 · 0 comments
Open

Make use of pwshlib for executing powershell commands #94

brajjan opened this issue Oct 31, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@brajjan
Copy link

brajjan commented Oct 31, 2023

Use Case

This gem allows the use of a long-lived manager to which Ruby can send PowerShell invocations and receive the exection output. This reduces the overhead time to execute PowerShell commands from seconds to milliseconds because each execution does not need to spin up a PowerShell process, execute a single pipeline, and tear the process down.

The manager operates by instantiating a custom PowerShell host process to which Ruby can then send commands over an IO pipe— on Windows machines, named pipes, on Unix/Linux, Unix Domain Sockets.

https://github.com/puppetlabs/ruby-pwsh

Describe the Solution You Would Like

Convert the "Facter::Util::Resolution.exec("#{powershell}" commands to make use of pwshlib instead for increased performance and the ability to use Powershell Core over Windows Powershell

Describe Alternatives You've Considered

Add the following parameters to the "Facter::Util::Resolution.exec("#{powershell}" command for faster load times and making sure that no powershell profile is loaded when executing commands

-NoProfile
-NonInteractive
-NoLogo
-ExecutionPolicy 'Bypass'

Additional Context

Add any other context or screenshots about the feature request here.

@brajjan brajjan added the enhancement New feature or request label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant