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

Support Custom InitialSessionState #132

Open
michaeltlombardi opened this issue May 14, 2021 · 0 comments
Open

Support Custom InitialSessionState #132

michaeltlombardi opened this issue May 14, 2021 · 0 comments
Labels
enhancement New feature or request feature

Comments

@michaeltlombardi
Copy link
Contributor

michaeltlombardi commented May 14, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature
Projects
None yet
Development

No branches or pull requests

1 participant