Skip to content

Update-PSResource should remove old module versions optionally with a switch #618

@o-l-a-v

Description

@o-l-a-v

Summary of the new feature / enhancement

When updating PowerShell modules with PowerShellGet, it would be great if the Update-PSResource cmdlet also handled the trash, that is optionally removing old versions of modules at the same time.

This could at least be an optional feature, maybe a switch?

I'd like this switch to be available and working, both when feeding a given module to update, but also if updating all modules.

The lack of this feature build in made me start work on this huge script some years ago.

I still use it. But if PowerShellGet v3 could get this cleanup functionality built in, it would be much better. :)

Proposed technical implementation details (optional)

Implement a switch for whether old versions should be nuked when a new version get's installed.

Default behavior could be either IMO, as long as we have a switch.

  • Least destructive change would be to not change the default behavior I guess.

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