Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Find-Module needs a -FullyQualifiedName ModuleSpecification parameter set #212

Open
@Jaykul

Description

@Jaykul

The module commands in PowerShell (Get-Module, Import-Module, Remove-Module, and even Get-Command etc.) all support a -FullyQualifiedName parameter which takes a [Microsoft.PowerShell.Commands.ModuleSpecification] object that has the Name and either a RequiredVersion or a MinimumVersion and/or a MaximumVersion ...

Find-Module accepts these parameters, but doesn't work with the objects (even when piped - because it fails to ignore null values), forcing scripts which work with modules to manually deal with Find-Module in awkward ways:

[hashtable]$mspec = @{}
$ModuleSpec | Get-Member -Type Properties | Where {$null -ne $ModuleSpec.($_.Name)} | % { $mspec.Add($_.Name, $Module.($_.Name)) }
Find-Module @mspec

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