Skip to content

Commit 71b35b0

Browse files
authored
Add cmdlet aliases: gres, usres, and svres (#1888)
1 parent 4c935c7 commit 71b35b0

File tree

7 files changed

+19
-2
lines changed

7 files changed

+19
-2
lines changed

src/Microsoft.PowerShell.PSResourceGet.psd1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@
4141
AliasesToExport = @(
4242
'Get-PSResource',
4343
'fdres',
44+
'gres',
4445
'isres',
4546
'pbres',
46-
'udres')
47+
'svres',
48+
'udres',
49+
'usres')
4750
PrivateData = @{
4851
PSData = @{
4952
Prerelease = 'preview3'

src/code/GetInstalledPSResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Microsoft.PowerShell.PSResourceGet.Cmdlets
1515
/// Returns a single resource or multiple resource.
1616
/// </summary>
1717
[Cmdlet(VerbsCommon.Get, "InstalledPSResource")]
18-
[Alias("Get-PSResource")]
18+
[Alias("Get-PSResource", "gres")]
1919
[OutputType(typeof(PSResourceInfo))]
2020
public sealed class GetInstalledPSResourceCommand : PSCmdlet
2121
{

src/code/SavePSResource.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace Microsoft.PowerShell.PSResourceGet.Cmdlets
1717
/// It returns nothing.
1818
/// </summary>
1919
[Cmdlet(VerbsData.Save, "PSResource", DefaultParameterSetName = "IncludeXmlParameterSet", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Low)]
20+
[Alias("svres")]
2021
public sealed class SavePSResource : PSCmdlet
2122
{
2223
#region Members

src/code/UninstallPSResource.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace Microsoft.PowerShell.PSResourceGet.Cmdlets
1717
/// Uninstall-PSResource uninstalls a package found in a module or script installation path.
1818
/// </summary>
1919
[Cmdlet(VerbsLifecycle.Uninstall, "PSResource", DefaultParameterSetName = NameParameterSet, SupportsShouldProcess = true)]
20+
[Alias("usres")]
2021
public sealed class UninstallPSResource : PSCmdlet
2122
{
2223
#region Parameters

test/GetInstalledPSResource/GetInstalledPSResource.Tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ Describe 'Test Get-InstalledPSResource for Module' -tags 'CI' {
153153
(Get-Alias Get-PSResource).Definition | Should -BeExactly 'Get-InstalledPSResource'
154154
}
155155

156+
It "Get definition for alias 'gres'" {
157+
(Get-Alias gres).Definition | Should -BeExactly 'Get-InstalledPSResource'
158+
}
159+
156160
It "Should not throw on ErrorAction ignore when no subdirectories are found" {
157161
{ Get-InstalledPSResource -Path $TestEmptyDirectoryPath -ErrorAction 'Ignore' } | Should -Not -Throw
158162
}

test/SavePSResourceTests/SavePSResourceLocal.Tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,8 @@ Describe 'Test Save-PSResource for local repositories' -tags 'CI' {
205205
$res.Name | Should -Be $moduleName
206206
$res.Version | Should -Be "1.0.0"
207207
}
208+
209+
It "Get definition for alias 'svres'" {
210+
(Get-Alias svres).Definition | Should -BeExactly 'Save-PSResource'
211+
}
208212
}

test/UninstallPSResourceTests/UninstallPSResource.Tests.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,8 @@ Describe 'Test Uninstall-PSResource for Modules' -tags 'CI' {
340340
$pkg.Name | Should -Be $testModuleName
341341
$pkg.Path.ToString().Contains("Documents") | Should -Be $true
342342
}
343+
344+
It "Get definition for alias 'usres'" {
345+
(Get-Alias usres).Definition | Should -BeExactly 'Uninstall-PSResource'
346+
}
343347
}

0 commit comments

Comments
 (0)