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

Get-ModuleFastPlan: Discuss keep as public command #27

Closed
johlju opened this issue Dec 21, 2023 · 9 comments
Closed

Get-ModuleFastPlan: Discuss keep as public command #27

johlju opened this issue Dec 21, 2023 · 9 comments

Comments

@johlju
Copy link
Contributor

johlju commented Dec 21, 2023

Note that install-modulefast -whatif will be replacing get-modulefastplan unless I can find a good way to keep the parameter logic all up to date between them, but get-modulefastplan will be preserved with a warning.

I am using Get-ModuleFastPlan to get a result to programmatically see what is needed to be updated. WhatIf wouldn't help with that, so sorry to see it go. I rather see it still being a supported public command if it is possible.

Originally posted by @johlju in #20 (comment)

@johlju johlju changed the title Get-ModuleFastPlan: Discuss keep as public command Get-ModuleFastPlan: Discuss keep as public command Dec 21, 2023
@JustinGrote
Copy link
Owner

JustinGrote commented Dec 21, 2023

@johlju have you tried -whatif? It generates and outputs the same plan as objects, literally the same as Get-ModuleFastPlan. There's nothing about -whatif that says it has to only output console stuff.

image

The reason I was planning to retire it is that the command surface for Install-ModuleFast is starting to get pretty broad, and in order for Get-ModuleFastPlan to support all the same functionality it all has to be duplicated (and subsequently tested). If this was a binary module that would be easy because I can put all that duplication into a parent class, but with script modules there's no way to define common parameters for a function that I'm aware of.

@JustinGrote
Copy link
Owner

I think to clarify, Get-ModuleFastPlan won't explicitly go away, it just won't get any new parameters/etc. unless it becomes necessary due to Install-ModuleFast parameter additions.

@johlju
Copy link
Contributor Author

johlju commented Dec 23, 2023

I tested -WhatIf now, it was not very intuitive having WhatIf-output in the build output - see below. It looks like something were not installed. Also, for some reason it returns two WhatIf-strings but looks like by design.

[pre-build] Starting Build Init
[pre-build] Creating required modules directory /Users/johlju/source/Sampler/output/RequiredModules.
[pre-build] Pre-pending '/Users/johlju/source/Sampler/output/RequiredModules' folder to PSModulePath
[pre-build] Resolving dependencies using preferred method.
[pre-build] Starting bootstrap process.
...
ModuleFast is configured to use Bleeding Edge (directly from ModuleFast's main branch).
What if: Performing the operation "Install 1 Modules" on target "/Users/johlju/source/Sampler/output/RequiredModules".  
What if: Performing the operation "Install 18 Modules" on target "/Users/johlju/source/Sampler/output/RequiredModules". 
...
[build] Starting build with InvokeBuild.

@johlju
Copy link
Contributor Author

johlju commented Dec 23, 2023

Maybe move the output to a PassThru parameter instead? That would be more intuitive that something is returned. 🤔

@johlju
Copy link
Contributor Author

johlju commented Dec 23, 2023

I think to clarify, Get-ModuleFastPlan won't explicitly go away, it just won't get any new parameters/etc. unless it becomes necessary due to Install-ModuleFast parameter additions.

That's good. Let's close this. Just wanted the dialog. 🙂

@JustinGrote
Copy link
Owner

@johlju What I can do is add a -Plan parameter that will basically be -WhatIf without the whatif output (it is extremely annoying there is no way to suppress whatif output without overriding the host).

@johlju
Copy link
Contributor Author

johlju commented Dec 23, 2023

Yes a -Plan parameter would be much better I think. Happy to see that.

@JustinGrote
Copy link
Owner

Yes a -Plan parameter would be much better I think. Happy to see that.

It's a tricky position because if it was any other module, it would mean get-modulefastplan would have all this functionality and UI surfaced. I think I need to consider this a bit, I could have a switch on the bootstrap for the default entrypoint to be plan vs install.

@johlju
Copy link
Contributor Author

johlju commented Dec 23, 2023

Thought about it a bit more and since Get-ModuleFastPlan exist, a Plan parameter could be seen as passing in a plan to Install-ModuleFast. So maybe OnlyPlan or something like that would be better. But I wait for what you come up with, what path you take. 😊

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

No branches or pull requests

2 participants