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

Idea for ability to optionally override default modules and scripts install path - Duscussion and contribution is welcome! #1673

Draft
wants to merge 63 commits into
base: master
Choose a base branch
from

Conversation

o-l-a-v
Copy link
Contributor

@o-l-a-v o-l-a-v commented Jul 13, 2024

PR Summary

What

I'm experimenting with a way to override PSResourceGet install path for modules and scripts, suggested in my comment #1494 (comment).

This PR already got the basic logic working for getting the path override if present! 🥳

image

Todo

  • Maintainers confirm this is something they want, else more work is for nothing.
  • Get env variable PSResourceGetInstallPathOverride if present and use it instead of default paths.
  • Create cmdlet Set-PSResourceInstallPathOverride -Path <path> -Scope <CurrentUser|AllUsers>.
    • Barebone functionality, as in set PSResourceGetInstallPathOverride and add it to PSModulePath if not already there.
    • -WhatIf
    • Check if running as admin and scope is current user?
    • ^ Add "-Force" or "-IgnorePermissionsCheck" switch?
  • ? Create cmdlet Get-PSResourceGetInstallPathOverride ?
  • ? Create cmdlet Remove-PSResourceGetInstallPathOverride ?
  • Make sure Get-PSResource searches for all paths in PSModulePath
  • Document changes.
  • Create tests.

Related issues / feature requests

PR Context

PR Checklist

@o-l-a-v o-l-a-v marked this pull request as draft July 13, 2024 12:23
@o-l-a-v o-l-a-v changed the title Install-path-override Idea for ability to optionally override default modules and scripts install path - Duscussion and contribution is welcome! Jul 13, 2024
@o-l-a-v
Copy link
Contributor Author

o-l-a-v commented Aug 21, 2024

@anamnavi, @alerickson Have you had any time to check out this idea? Any thoughts? 🤔


Edit: It's probably better to use powershell.settings.json for this, ref:

Whichever solution you want for PSResourceGet, let's make it happen. I can try to do it, but I'd first want to hear what alternative you'd like. 🙂


Edit 2: Seems Windows PowerShell does not support powershell.config.json in my limited testing:

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

Successfully merging this pull request may close these issues.

1 participant