Skip to content

Force parameter on Install-Module and Update-Module should be split into 2 parameters #16

@deadlydog

Description

@deadlydog

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions