Skip to content

Support Custom InitialSessionState #132

@michaeltlombardi

Description

@michaeltlombardi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions