Closed johlju closed 8 months ago
@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.
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.
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.
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.
Maybe move the output to a PassThru
parameter instead? That would be more intuitive that something is returned. 🤔
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. 🙂
@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).
Yes a -Plan
parameter would be much better I think. Happy to see that.
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.
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. 😊
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 https://github.com/JustinGrote/ModuleFast/issues/20#issuecomment-1865872876