Skip to content

Conversation

@trackd
Copy link
Contributor

@trackd trackd commented Aug 22, 2024

added helper function to check powershell.config.json for PSModulePath.

it will only use that when -Destination is not present.

@JustinGrote JustinGrote self-assigned this Aug 23, 2024
@JustinGrote
Copy link
Owner

Thanks! I'll try to review it when I can

* Consolidate Path Determination to use PowerShell implementation rather than duplicating it
* Simplify Destination Handling
* Focus on CurrentUser Support
* Only edit the profile in very specific circumstances where the folder isn't already in the PSModulePath.
@JustinGrote
Copy link
Owner

JustinGrote commented Sep 4, 2024

Thanks for taking the time to write the PR, and sorry for the delay.

I rewrote things to utilize the PowerShell logic of determining the module folder, so we don't have to deal with the powershell.json at all. This does use private methods but they are unlikely to change, and if they do, it will be because a new public method is available and we can test for that in a subsequent release.

I also simplified a lot of the flow, this was getting overly complicated and band-aided as I wrote it so it works on much more of an exception flow now to minimize the nesting.

Let me know what you and @Jaykul think, and try it out. Unfortunately writing tests is going to be tricky without potentially demolishing an existing config instance, perhaps I'll write them such that they'll trigger in CI only, but my manual testing shows it works fine in both CurrentUser and AllUser scenarios.

@JustinGrote JustinGrote merged commit 74bbac1 into JustinGrote:main Sep 4, 2024
@JustinGrote JustinGrote changed the title fixes #89, check powershell.config.json for PSModulePath ✨ Use PowerShell internals for default installation location determination Sep 4, 2024
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.

3 participants