PowerShell / PowerShell/PSResourceGet
Add `Unpublish-PSResource` command to unlist/hide module versions programmatically
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 576
- Forks
- 114
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 7
Description
Summary of the new feature / enhancement
As a PowerShell user automating module publishing workflows, I want a command to quickly unlist or hide specific versions of a module (such as prereleases after the full version is published), so that I can ensure only relevant versions are visible on the PowerShell Gallery without manual UI steps.
Currently, unlist functionality exists in the PowerShell Gallery UI and is also supported via API key permissions, but there is no native PowerShell command to do this in automation scenarios. This limits streamlined management when transitioning from prerelease to stable versions or when hiding obsolete/pre-release versions is required within CI/CD systems.
Proposed technical implementation details (optional)
Add a new cmdlet named Unpublish-PSResource. It should accept similar parameters as Find-PSResource, with the addition of -ApiKey (similar to Publish-PSResource). This command would use the API key (with appropriate unlist permission) to programmatically unlist or hide the specified package version on the Gallery.
The command should support:
- Specifying a specific version (including prerelease versions) to unlist
- Pipeline input from
Find-PSResourceto unpublish multiple resources at once
Example usage:
Unpublish-PSResource -Repository PSGallery -ApiKey $APIKey -Name $moduleName -Version 2.0.1 -Prerelease
# Unpublish multiple versions via pipeline
Find-PSResource -Name $moduleName -Version "2.0.1" -Prerelease | Unpublish-PSResource -Repository PSGallery -ApiKey $APIKey
This feature would greatly improve automation workflows for module publishers and mirror the manual UI and API support for unlisting that already exists.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing Publish-PSResource and Find-PSResource command paths, then inspect the PowerShell Gallery API's unlisting and permission behavior. Done means Unpublish-PSResource can target specific stable or prerelease versions, accept an API key, and process pipeline input for multiple resources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100