Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Oct 7, 2025

Summary

This PR adds short aliases for three PowerShell cmdlets as requested in issue #1984:

  • gres for Get-InstalledPSResource
  • usres for Uninstall-PSResource
  • svres for Save-PSResource

These aliases follow the existing naming convention used by other cmdlets in the module (e.g., isres for Install-PSResource, udres for Update-PSResource, fdres for Find-PSResource).

Changes

Code Changes

  • Added [Alias("gres")] attribute to GetInstalledPSResourceCommand in GetInstalledPSResource.cs
  • Added [Alias("usres")] attribute to UninstallPSResource in UninstallPSResource.cs
  • Added [Alias("svres")] attribute to SavePSResource in SavePSResource.cs
  • Updated AliasesToExport array in Microsoft.PowerShell.PSResourceGet.psd1 to include the new aliases in alphabetical order

Test Changes

  • Added test case for gres alias in GetInstalledPSResource.Tests.ps1
  • Added test case for usres alias in UninstallPSResource.Tests.ps1
  • Added test case for svres alias in SavePSResourceLocal.Tests.ps1

All test cases follow the established pattern of verifying that (Get-Alias <alias>).Definition matches the expected cmdlet name.

Example Usage

After these changes, users can use the shorter aliases:

# Instead of Get-InstalledPSResource
gres -Name MyModule

# Instead of Uninstall-PSResource
usres -Name MyModule

# Instead of Save-PSResource
svres -Name MyModule -Path ./SavedModules

Fixes #1984

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 1k9vsblobprodcus379.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • 37cvsblobprodcus359.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • 4myvsblobprodcus32.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • 51yvsblobprodcus36.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • 5dkvsblobprodcus355.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • 7devsblobprodcus323.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • 7k6vsblobprodcus337.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • 7tjvsblobprodcus341.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • bcnvsblobprodcus378.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • c50vsblobprodcus330.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • c78vsblobprodcus322.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • dlbvsblobprodcus316.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • fdpvsblobprodcus345.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • gbsvsblobprodcus365.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • kh4vsblobprodcus325.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • kmuvsblobprodcus389.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • l49vsblobprodcus358.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • m6xvsblobprodcus342.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • pkvvsblobprodcus321.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • s4uvsblobprodcus326.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • tphvsblobprodcus375.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • uy6vsblobprodcus34.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet publish --configuration Debug --framework net472 --output bin/Debug/net472/publish (dns block)
  • yttvsblobprodcus357.vsblob.vsassets.io

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Cmdlet Aliases</issue_title>
<issue_description>### Summary of the new feature / enhancement

Round out aliases for all cmdlets. gires for Get-InstalledPSResource and usres for Uninstall-PSResource. Other Update verbs, Save, and Publish too.

Proposed technical implementation details (optional)

[Alias('gires')] attribute with alias defined in psd1.</issue_description>

<agent_instructions>Add alias "gres" for "Get-InstalledPSResource" , "usres" for "Uninstall-PSResource" "svres" for "Save-PSResource" and add tests for each that are similar to " It "Get definition for alias 'udres'" {
(Get-Alias udres).Definition | Should -BeExactly 'Update-PSResource'
}"</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #1857

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: alerickson <25858831+alerickson@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Add cmdlet aliases for resource management Add cmdlet aliases: gres, usres, and svres Oct 7, 2025
@Copilot Copilot AI requested a review from alerickson October 7, 2025 19:30
Copilot finished work on behalf of alerickson October 7, 2025 19:30
@alerickson
Copy link
Member

/azp run PowerShell.PSResourceGet

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alerickson
Copy link
Member

/azp run PowerShell.PSResourceGet

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@alerickson alerickson marked this pull request as ready for review October 7, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cmdlet Aliases
2 participants