Add PSResourceGet provider to replace deprecated PowerShellGet support#143
Open
AdeeelAsif wants to merge 3 commits into
Open
Add PSResourceGet provider to replace deprecated PowerShellGet support#143AdeeelAsif wants to merge 3 commits into
AdeeelAsif wants to merge 3 commits into
Conversation
This was referenced May 1, 2026
added 3 commits
May 10, 2026 19:21
There was a problem hiding this comment.
Pull request overview
Adds an alternative PSDepend provider that installs PowerShell modules/resources via PSResourceGet (intended as a replacement option for deprecated PowerShellGet-based flows), and registers it in the default dependency type map.
Changes:
- Added a new provider script
PSResourceGet.ps1that usesFind-PSResource,Install-PSResource, andSave-PSResource. - Registered the new provider in
PSDependMap.psd1(plus formatting alignment updates).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| PSDepend/PSDependScripts/PSResourceGet.ps1 | New PSResourceGet-backed provider implementation (install/save + version checking + optional import flow). |
| PSDepend/PSDependMap.psd1 | Registers the new provider type and reformats map entries for alignment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+228
to
+234
| $availableParameters = (Get-Command "Install-Module").Parameters | ||
| $tempParams = $Params.Clone() | ||
| foreach($thisParameter in $Params.Keys) | ||
| { | ||
| if(-Not ($availableParameters.ContainsKey($thisParameter))) | ||
| { | ||
| Write-Verbose -Message "Removing parameter [$thisParameter] from [Install-Module] as it is not available" |
| { | ||
| Write-Verbose "Installing [$Name] with scope [$Scope]" | ||
| Write-verbose "$params" | ||
| Install-PSResource @params |
| Defaults to PSGallery. | ||
|
|
||
| .PARAMETER NoClobber | ||
| Allow installation of modules that overwrite existing commands. |
Comment on lines
+85
to
+91
| SkipPublisherCheck = $true | ||
| } | ||
| } | ||
| } | ||
|
|
||
| # Install the latest BuildHelpers module from a custom registered repository | ||
| # and bypass the catalog signing check. |
Comment on lines
+87
to
+91
| PsResourceGet = @{ | ||
| Script = 'PSResourceGet.ps1' | ||
| Description = 'Installs a PowerShell resource from a PowerShell repository using PSResourceGet' | ||
| Supports = 'windows', 'core', 'macos', 'linux' | ||
| } |
Comment on lines
+87
to
+91
| PsResourceGet = @{ | ||
| Script = 'PSResourceGet.ps1' | ||
| Description = 'Installs a PowerShell resource from a PowerShell repository using PSResourceGet' | ||
| Supports = 'windows', 'core', 'macos', 'linux' | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
PowerShellGet is deprecated by Microsoft, PSResourceGet is the supported replacement and provides a modern, unified API for managing PowerShell modules and other resources.
What’s in this PR
PsResourceGetprovider based onPsGalleryModule.ps1Find-PSResourceInstall-PSResourceSave-PSResourceWhy this approach
The goal was to keep the integration simple and non-invasive by:
This allows PsDepend users to adopt PSResourceGet without breaking existing
workflows.
Notes
This PR does not remove or modify the existing PowerShellGet provider.
It only adds an alternative provider for environments where PSResourceGet is preferred or required.
I’d be happy to adjust naming, behavior, or documentation if needed.