puppetlabs / puppetlabs/ruby-pwsh

Support Custom InitialSessionState

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

Nobody has claimed this yet.

feature
Dominant language
Ruby
Stars
20
Forks
27
Avg merge
1d 7h
Merged PRs (30d)
4

Description

Use Case

As a developer leveraging the PowerShell Manager, I want to be able to preload the manager's Session State with needed options, such as (but not limited to):

  • Session Configuration
  • Module Import
  • Variables
  • Execution Policy
  • Language Mode
  • Startup Scripts
  • Transcript Directory
  • Command allow list

Describe the Solution You Would Like

Extension of the options hash for the Pwsh::Manager which allow users to specify InitialSessionState overrides from default which are implemented in the init.ps1 template file.

Something like:

options = {
  initial_session_state: {
    execution_policy: 'Unrestricted',
    import_psmodules_from_path: ['C:\path\to\foo.psd1', 'C:\path\to\bar.psd1'],
    session_configuration_file_path: 'C:\path\to\configuration.pssc'
  },
}

With a set list of supported surfaces, documentation, and testing.

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 by examining the Pwsh::Manager options handling and the init.ps1 template where default InitialSessionState behavior is implemented. Define the supported InitialSessionState surfaces from the request, then add documentation and tests covering the options and their effects. Done means callers can configure the supported session settings through the manager options.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.