voxpupuli / voxpupuli/puppet-patching_as_code

Make use of pwshlib for executing powershell commands

Open
#94 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Puppet
Stars
10
Forks
18
Avg merge
6h 10m
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Facter::Util::Resolution.exec("#{powershell}") call sites and review how the linked ruby-pwsh project exposes pwshlib. Trace the current PowerShell command execution path and identify the affected Windows and Unix/Linux behavior. Done means those invocations use the long-lived pwshlib manager while retaining equivalent command output and platform support.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, ruby
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.