-
Notifications
You must be signed in to change notification settings - Fork 99
Idea for ability to optionally override default modules and scripts install path - Duscussion and contribution is welcome! #1673
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
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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
...ke path to returning standard paths shorter
...ke path to returning standard paths shorter
...werShell--PSResourceGet into install-path-override
@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:
- 2021年08月12日 Let's move PSModulePath out of the documents folder PowerShell#15552 (comment)
- 2024年08月20日 Allow to specify custom module path in Install-PSResource #1494 (comment)
- 2024年08月20日 Let's move PSModulePath out of the documents folder PowerShell#15552 (comment)
- 2024年08月22日 Allow to specify custom module path in Install-PSResource #1494 (comment)
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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! 🥳
imageTodo
PSResourceGetInstallPathOverrideif present and use it instead of default paths.Set-PSResourceInstallPathOverride -Path <path> -Scope <CurrentUser|AllUsers>.PSResourceGetInstallPathOverrideand add it toPSModulePathif not already there.-WhatIfGet-PSResourceGetInstallPathOverride?Remove-PSResourceGetInstallPathOverride?Get-PSResourcesearches for all paths inPSModulePathGet-PSResourcedoes not search in user context environment variablePSModulePath#889Related issues / feature requests
%OneDriveCommercial%if OneDrive for Business Known Folder Move (KFM) is enabled #627Get-PSResourcedoes not search in user context environment variablePSModulePath#889PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.