-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Milestone
Description
In order to provide a consistent interface to scripters using Get-Module and Import-Module, the Install-Module command should accept similar values as Get-Module.
Since Get-Module can only accept module version requirements using the FullyQualifiedModule parameter (which takes a ModuleSpecification[] or a hash table which can cast to one) it would be handy if Install-Module could accept the same object.
Ideally, Install-Module should have a [ModuleSpecification[]]$FullyQualifiedName parameter.
Failing that, Install-Module needs to add a ModuleName alias to it's Name parameter so that we could splat the hashtables, like this:
param(
[Alias("Name")][string]$ModuleName,
[Version]$Version
)
$module = [hashtable]$PSBoundParameter
if (-not (Get-Module -FullyQualifiedName $Module -ListAvailable)) {
Install-Module @Module # this doesn't currently work
}
Import-Module -FullyQualifiedName $Module