Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Get-PSResource' alias to 'Get-InstalledPSResource' #1216

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Microsoft.PowerShell.PSResourceGet.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'Update-PSResource')

VariablesToExport = 'PSGetPath'
AliasesToExport = @()
AliasesToExport = @('Get-PSResource')
PrivateData = @{
PSData = @{
Prerelease = 'beta22'
Expand Down
1 change: 1 addition & 0 deletions src/code/GetInstalledPSResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Microsoft.PowerShell.PSResourceGet.Cmdlets
/// Returns a single resource or multiple resource.
/// </summary>
[Cmdlet(VerbsCommon.Get, "InstalledPSResource")]
[Alias("Get-PSResource")]
[OutputType(typeof(PSResourceInfo))]
public sealed class GetInstalledPSResourceCommand : PSCmdlet
{
Expand Down
6 changes: 6 additions & 0 deletions test/GetInstalledPSResource/GetInstalledPSResource.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ $testCases =
$res.Prerelease | Should -Be "alpha"
}

It "Get resource using alias 'Get-PSResource'" {
$pkg = Get-PSResource -Name $testModuleName
$pkg.Name | Should -Contain $testModuleName
$pkg.Type | Should -Contain "Module"
alerickson marked this conversation as resolved.
Show resolved Hide resolved
}

# Windows only
It "Get resource under CurrentUser scope - Windows only" -Skip:(!(Get-IsWindows)) {
$pkg = Get-InstalledPSResource -Name $testModuleName -Scope CurrentUser
Expand Down
Loading