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

How to load locally built module #3451

Closed
1 task done
dkaszews opened this issue Oct 17, 2022 · 3 comments
Closed
1 task done

How to load locally built module #3451

dkaszews opened this issue Oct 17, 2022 · 3 comments
Labels
Issue-Docs It's a documentation issue.

Comments

@dkaszews
Copy link
Contributor

Prerequisites

  • Write a descriptive title.

Issue summary

I wanted to test some changes to the module, but cannot figure out how to load it. The readme only says that build artifacts are in bin/(Debug|Release)/PSReadLine, but Import-Module PSReadLine.psm1 does nothing, while Import-Module PSReadLine.psd1 causes error Assembly with same name already loaded. I gather that the problem is that I'm using PowerShell 7.3 which autoloads the PSReadLine it ships with and you cannot unload the assembly according to StackOverflow.

Please provide at least one of the following, in form of instructions in readme/contributor guide or a script:

  1. Replace already loaded module with one built locally
  2. Start new PowerShell instance which loads module built locally instead of the default one
@dkaszews dkaszews added the Issue-Docs It's a documentation issue. label Oct 17, 2022
@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Oct 17, 2022
@iSazonov
Copy link

You could start pwsh without PSRL with -NonInteractive.

@dkaszews
Copy link
Contributor Author

Thanks, had to use combination of -NonInteractive -NoProfile to get it to work, probably because I have, Set-PSReadLineOption in my $PROFILE which forced load anyway. After that, I can load profile to get back my settings.

Should I add this hint to README.md? I think a Start-DevPowerShell.ps1 like in the main repo would make sense, something like pwsh -NonInteractive -NoProfile -c 'Import-Module ... && . $PROFILE' with some extra options would be great.

Is it possible to enable interactive mode back on, or should this be a non-issue not impacting PSReadLine?

@springcomp
Copy link
Contributor

@dkaszews You may be interested in this discussion.

@StevenBucher98 StevenBucher98 removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Docs It's a documentation issue.
Projects
None yet
Development

No branches or pull requests

4 participants