Skip to content

Commit d40714f

Browse files
committed
Add aliases to match V2 user experience
1 parent f2d69ee commit d40714f

File tree

1 file changed

+40
-28
lines changed

1 file changed

+40
-28
lines changed

src/CompatPowerShellGet.psm1

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function Convert-VersionParamaters
122122
elseif ( ! $RequiredVersion -and ! $MinimumVersion -and ! $MaximumVersion ) {
123123
return $null
124124
}
125-
elseif ( $RequiredVersion -and ! $MinimumVersion -and ! $MaximumVersion ) {
125+
elseif ( $RequiredVersion -and ! $MinimumVersion -and ! $MaximumVersion ) {
126126
return "$RequiredVersion" }
127127

128128
# now return the appropriate string
@@ -462,7 +462,7 @@ param(
462462
}
463463

464464
# PARAMETER MAP
465-
# add new specifier
465+
# add new specifier
466466
$PSBoundParameters['Type'] = 'module'
467467
# Parameter translations
468468
$verArgs = @{}
@@ -659,7 +659,7 @@ param(
659659
}
660660

661661
# PARAMETER MAP
662-
# add new specifier
662+
# add new specifier
663663
$PSBoundParameters['Type'] = 'script'
664664
# Parameter translations
665665
$verArgs = @{}
@@ -1201,11 +1201,11 @@ param(
12011201
[ValidateNotNullOrEmpty()]
12021202
[string]
12031203
${Version},
1204-
1204+
12051205
[ValidateNotNullOrEmpty()]
12061206
[string]
12071207
${Author},
1208-
1208+
12091209
[Parameter(Mandatory=$true)]
12101210
[ValidateNotNullOrEmpty()]
12111211
[string]
@@ -1222,39 +1222,39 @@ param(
12221222
[ValidateNotNullOrEmpty()]
12231223
[string]
12241224
${Copyright},
1225-
1225+
12261226
[ValidateNotNullOrEmpty()]
12271227
[Object[]]
12281228
${RequiredModules},
1229-
1229+
12301230
[ValidateNotNullOrEmpty()]
12311231
[string[]]
12321232
${ExternalModuleDependencies},
12331233

12341234
[ValidateNotNullOrEmpty()]
12351235
[string[]]
12361236
${RequiredScripts},
1237-
1237+
12381238
[ValidateNotNullOrEmpty()]
12391239
[string[]]
12401240
${ExternalScriptDependencies},
12411241

12421242
[ValidateNotNullOrEmpty()]
12431243
[string[]]
12441244
${Tags},
1245-
1245+
12461246
[ValidateNotNullOrEmpty()]
12471247
[Uri]
12481248
${ProjectUri},
1249-
1249+
12501250
[ValidateNotNullOrEmpty()]
12511251
[Uri]
12521252
${LicenseUri},
1253-
1253+
12541254
[ValidateNotNullOrEmpty()]
12551255
[Uri]
12561256
${IconUri},
1257-
1257+
12581258
[string[]]
12591259
${ReleaseNotes},
12601260

@@ -1753,7 +1753,7 @@ param(
17531753
if ( $PSBoundParameters['Force'] ) { $null = $PSBoundParameters.Remove('Force') }
17541754
if ( $PSBoundParameters['AcceptLicense'] ) { $null = $PSBoundParameters.Remove('AcceptLicense') }
17551755
# END PARAMETER MAP
1756-
1756+
17571757
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand('Save-PSResource', [System.Management.Automation.CommandTypes]::Cmdlet)
17581758
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
17591759

@@ -2565,11 +2565,11 @@ param(
25652565
[ValidateNotNullOrEmpty()]
25662566
[string]
25672567
${Version},
2568-
2568+
25692569
[ValidateNotNullOrEmpty()]
25702570
[string]
25712571
${Author},
2572-
2572+
25732573
[ValidateNotNullOrEmpty()]
25742574
[string]
25752575
${Description},
@@ -2585,7 +2585,7 @@ param(
25852585
[ValidateNotNullOrEmpty()]
25862586
[string]
25872587
${Copyright},
2588-
2588+
25892589
[ValidateNotNullOrEmpty()]
25902590
[Object[]]
25912591
${RequiredModules},
@@ -2597,27 +2597,27 @@ param(
25972597
[ValidateNotNullOrEmpty()]
25982598
[string[]]
25992599
${RequiredScripts},
2600-
2600+
26012601
[ValidateNotNullOrEmpty()]
26022602
[string[]]
26032603
${ExternalScriptDependencies},
26042604

26052605
[ValidateNotNullOrEmpty()]
26062606
[string[]]
26072607
${Tags},
2608-
2608+
26092609
[ValidateNotNullOrEmpty()]
26102610
[Uri]
26112611
${ProjectUri},
2612-
2612+
26132613
[ValidateNotNullOrEmpty()]
26142614
[Uri]
26152615
${LicenseUri},
26162616

26172617
[ValidateNotNullOrEmpty()]
26182618
[Uri]
26192619
${IconUri},
2620-
2620+
26212621
[string[]]
26222622
${ReleaseNotes},
26232623

@@ -2694,11 +2694,11 @@ param(
26942694
[ValidateNotNullOrEmpty()]
26952695
[string]
26962696
${Version},
2697-
2697+
26982698
[ValidateNotNullOrEmpty()]
26992699
[string]
27002700
${Author},
2701-
2701+
27022702
[ValidateNotNullOrEmpty()]
27032703
[string]
27042704
${Description},
@@ -2714,7 +2714,7 @@ param(
27142714
[ValidateNotNullOrEmpty()]
27152715
[string]
27162716
${Copyright},
2717-
2717+
27182718
[ValidateNotNullOrEmpty()]
27192719
[Object[]]
27202720
${RequiredModules},
@@ -2726,27 +2726,27 @@ param(
27262726
[ValidateNotNullOrEmpty()]
27272727
[string[]]
27282728
${RequiredScripts},
2729-
2729+
27302730
[ValidateNotNullOrEmpty()]
27312731
[string[]]
27322732
${ExternalScriptDependencies},
27332733

27342734
[ValidateNotNullOrEmpty()]
27352735
[string[]]
27362736
${Tags},
2737-
2737+
27382738
[ValidateNotNullOrEmpty()]
27392739
[Uri]
27402740
${ProjectUri},
2741-
2741+
27422742
[ValidateNotNullOrEmpty()]
27432743
[Uri]
27442744
${LicenseUri},
27452745

27462746
[ValidateNotNullOrEmpty()]
27472747
[Uri]
27482748
${IconUri},
2749-
2749+
27502750
[string[]]
27512751
${ReleaseNotes},
27522752

@@ -2816,6 +2816,11 @@ param(
28162816
#>
28172817
}
28182818

2819+
New-Alias -Name fimo -Value Find-Module
2820+
New-Alias -Name inmo -Value Install-Module
2821+
New-Alias -Name pumo -Value Publish-Module
2822+
New-Alias -Name upmo -Value Update-Module
2823+
28192824
$functionsToExport = @(
28202825
"Find-Command",
28212826
"Find-DscResource",
@@ -2843,4 +2848,11 @@ $functionsToExport = @(
28432848
"Update-ScriptFileInfo"
28442849
)
28452850

2846-
export-ModuleMember -Function $functionsToExport
2851+
$aliasesToExport = @('
2852+
fimo',
2853+
'inmo',
2854+
'pumo',
2855+
'upmo'
2856+
)
2857+
2858+
export-ModuleMember -Function $functionsToExport -Alias $aliasesToExport

0 commit comments

Comments
 (0)