-
Notifications
You must be signed in to change notification settings - Fork 101
Description
When using Install-Module and Update-Module you can use the -Force parameter to force a version to be reinstalled even if it’s already installed, as well as to bypass prompting the user for confirmation. So the -Force parameter can be used for 2 different purposes.
The problem is that you may not always want to do both. For example, in automated scripts used for cron jobs I typically don’t want to prompt the user to install a module, since it is not running interactively. I can use the -Force parameter to suppress the prompts. However, using the -Force parameter also means that the module is unnecessarily downloaded and reinstalled every time the cron job runs, resulting in longer script run times and unnecessary errors when the network is unavailable. This is just one example scenario, but there are many others.
I propose splitting the -Force parameter into 2 separate parameters. To ensure backward compatibility, the -Force parameter should be kept, but perhaps marked as deprecated, and 2 new parameters introduced. They could perhaps be named something like -SuppressPrompts and -ReinstallIfNecessary.