Saturday, October 11, 2025
HomePowershellPSResourceGet is mostly obtainable - PowerShell Workforce

PSResourceGet is mostly obtainable – PowerShell Workforce


Microsoft.PowerShell.PSResourceGet is a continuation of the PowerShellGet 3.0 undertaking.
The module underneath this new title is now typically obtainable on the PowerShell Gallery.

The documentation for PSResourceGet can also be reside.

Easy methods to set up the module

To put in from PSResourceGet (which is included since PowerShell 7.4 Preview 5)

Set up-PSResource -Identify Microsoft.PowerShell.PSResourceGet

To put in from PowerShellGet 2.2.5

Set up-Module -Identify Microsoft.PowerShell.PSResourceGet

With this launch we now have additionally included an replace to the PowerShell Gallery UI to
add a tab within the set up choices for PSResourceGet.

This module is supported on all supported variations of PowerShell together with Home windows PowerShell 5.1.

Updates from the discharge candidate

From the discharge candidate we addressed excessive precedence low threat bugs, these included:

  • Repair RequiredResource silent failures
  • Repair Artifactory v2 and v3 endpoint failures
  • Repair ADO v2 feed set up failures
  • Mechanically set the ApiVersion to v2 for repositories imported from PowerShellGet

What’s PSResourceGet/what are the targets

PSResourceGet is a whole re-write of PowerShellGet, the package deal supervisor for PowerShell, with the next targets:

  • Create a extra intuitive package deal supervisor: Make PowerShell useful resource administration extra intuitive and simpler to make use of by eradicating pointless prompts when potential.
  • Handle high buyer points: Lots of the high buyer points in earlier variations of the module have been difficult to resolve due to structure choices made early on within the improvement of PowerShellGet.
  • Enable for a easy transition to a greater expertise: Transitioning from decrease variations of PSResourceGet ought to be as painless as potential. With the assistance of our compatibility layer defined in additional element under, our purpose is to allow customers and scripts constructed on PowerShellGet 2.0 to maneuver seamlessly to the PSResourceGet engine.
  • Enhance maintainability of the codebase: This purpose is addressed by eradicating the supplier mannequin that PowerShellGet was initially constructed on.

Because of this PowerShellGet 3.0 doesn’t take a dependency on OneGet, NuGet or some other package deal supplier due to this fact simplifying the codebase.

Utilizing the teachings discovered from earlier variations of PowerShellGet, together with a cleaner implementation and interface, we now have improved effectivity, efficiency and high quality, permitting us to extra rapidly deal with bugs as they come up and iterate on our vNext points.

Why make a complete new module/why the rename

After we initially launched the brand new undertaking we launched it as PowerShellGet v3, a serious replace to PowerShellGet.
Throughout this time we additionally launched a brand new cmdlet interface (Set up-PSResource vs Set up-Module),
this was finished for 2 major causes:

  1. To simplify the cmdlet interface
  2. The cmdlets now help extra than simply modules (scripts, nupkgs and so on..)

Along with this main breaking change, there have been different smaller breaking modifications to the
cmdlet interface made to repair bugs or enhance usability.

Given the numerous breaking modifications once we made the choice to ship the brand new model in PowerShell 7.4,
there was concern that we’d break of us– particularly these utilizing PowerShellGet cmdlets in CI/CD or different automation.
By group collaboration we decided that one of the best path ahead was to start out contemporary with a brand new
module title, and to introduce PowerShellGet v3 as a compatibility layer to bridge the hole between the
previous cmdlet interface, and the brand new engine enhancements.
For extra info on how this determination was made learn this weblog put up.
For extra info on when to make use of which module or methods to use PowerShellGet with the brand new engine through compat layer confer with the ‘When to make use of PowerShellGet v2/v3’ part under.

Transport in PowerShell

PSResourceGet ships inbox in PowerShell 7.4, facet by facet with PowerShellGet 2.2.5.
We’ve got shipped the previous few previews in addition to the discharge candidate for
PSResourceGet in 7.4 and this has been a fantastic mechanism for utilization and suggestions.

We’re presently exploring choices for delivery PSResourceGet inbox in Home windows PowerShell 5.1
if this is a crucial state of affairs for you please tell us in this GitHub problem.

New Options (in comparison with PowerShellGet v2)

Along with addressing lengthy standing bugs and efficiency, usability and supportability points,
we additionally added some new options in PSResourceGet 1.0.0.
A few of these options embody credential persistence, RequiredResource recordsdata, and help for extra repositories (together with nuget v3 repositories).
For extra info on supported repositories, confer with the part under.

Credential Persistence

This group contributed characteristic permits you to present details about the place a credential is saved when registering the
PSResourceRepository utilizing a -CredentialInfo parameter.
This parameter takes a PSCredentialInfo object which takes a Vault title and Secret title.
The key will then be pulled to authenticate to the Repository on future calls.
This characteristic takes benefit of SecretManagement, for extra info on SecretManagement refer the documentation.

Necessities

  • Microsoft.PowerShell.SecretManagement
  • Any vault extension registered (for this instance I’ll use Microsoft.PowerShell.SecretStore)
  • A repository to hook up with (for this instance I’ll use Artifactory)

Getting began

For this instance I’m going to be utilizing SecretStore to retailer my credentials for an Artifactory repository.
This may be repeated with any SecretManagement extension vault, and with any repository.
First, I would like to verify I’ve a SecretManagement vault arrange, with my credential saved.

PS C:Customers > Get-SecretInfo
Identify          Kind         VaultName
----          ----         ---------
jFrogCred     PSCredential SecretStore

Then I can create a PSCredentialInfo object to cross into my PSResourceRepository registration, to create this I cross within the title of the vault and the title of the key.

$credentialInfo = New-Object Microsoft.PowerShell.PSResourceGet.UtilClasses.PSCredentialInfo ("SecretStore", "jfrogCred")

Now I’m able to register the repository object, I’ll cross in a pleasant title, a URI for the repository, and the CredentialInfo. I additionally use the -Trusted swap as a result of I can be controlling what will get revealed to it.

Register-PSResourceRepository -Identify artifactory `
-URI " https://<title>.jfrog.io/artifactory/api/nuget/v3/<Repository-Identify>
-Trusted `
-CredentialInfo $credentialInfo `

Now I can run Get-PSResourceRepository to see my registered repositories

PS C:Customers > Get-PSResourceRepository

Identify        Uri                                                                                     Trusted Precedence
----        ---                                                                                     ------- --------
artifactory https://<title>.jfrog.io/artifactory/api/nuget/v3/<Repository-Identify>                      True    50      
PSGallery   https://www.powershellgallery.com/api/v2                                                False   50  

If the repository is empty you’ll need to start by publishing to it. I’ve saved my API key for publishing to the repository in my SecretStore.

Publish-PSResource -Path .Get-Good day -Repository artifactory -ApiKey (Get-Secret jfrogPublish)

Now I can discover and set up PSResources from my repository while not having to offer a credential at every name.

PS C:Customers> Discover-PSResource -Identify Get-Good day -Repository artifactory

Identify      Model Prerelease Repository  Description
----      ------- ---------- ----------  -----------
Get-Good day 0.0.2.0            artifactory check module

PS C:Customers> Set up-PSResource Get-Good day

Utilizing RequiredResources

Set up-PSResource can settle for a path to a psd1 or json file (utilizing -RequiredResourceFile), or a hashtable or json (utilizing -RequiredResource).

Getting Began

The -RequiredResource parameter can take both a hashtable or a json format string.
The next instance reveals methods to format these inputs.

Set up-PSResource -RequiredResource @{
  'Configuration' = @{
    model = '[1.3.1,2.0]'
    repository = 'PSGallery'                        
   }
  'Pester'        = @{
    model = '[4.4.2,4.7.0]'
    repository = 'PSGallery'
    prerelease = $true
  }
}

On this case the modules named “Configuration”, and “Pester” can be put in.
The json format would be the similar as if this hashtable is handed to ConvertTo-Json:

"{
  'Pester': {
    'allowPrerelease': true,
    'model': '[4.4.2,4.7.0]',
    'repository': 'PSGallery'
  },
  'Configuration': {
    'model': '[1.3.1,2.0]',
    'repository': 'PSGallery'
  }
}"

The older System.Model 4 half model sort can be supported to retain compatibility with current revealed modules utilizing that format.
Declared dependencies are searched and put in utilizing the identical belief algorithm as for Set up-PSResource.

The -RequiredResourceFile parameter can settle for both a psd1 or a json file.
The psd1 ought to use the identical format because the hashtable above, the json file ought to use the identical
format because the json sting above.

Supported Repositories

On this launch we made an effort to help repositories which beforehand labored
with PowerShellGet in addition to add help for brand new repositories.

  • NuGet.org
  • NuGet.Server feeds
  • Azure Artifacts (v2 and v3)
  • GitHub packages
  • Artifactory (v2 and v3 feeds)
  • MyGet.org
  • File-share-based

For extra info on methods to get began with these repositories, take a look at our documentation.

If a repository you employ isn’t on this listing, and doesn’t work with
your testing please file a problem and tell us.
If points asking for brand new repository help get sufficient group help
we are going to contemplate including help.

Anticipate to see new repositories and repository sorts added to this listing sooner or later.

With a view to import your repositories from PowerShellGet run the operate Import-PSGetRepository.

Different useful options to find out about

  • You may set up to an area path by utilizing Save-PSResource with the -IncludeXML parameter.
    Word that in the event you do that you’ll need to import the module manually or add the trail to your
    PSModulePath atmosphere variable so it may be detected by the PowerShell module import system.
  • You should use aliases for Set up-PSResource, Discover-PSResource, Replace-PSResource, Publish-PSResource (‘isres’,’fdres’,’udres’,’pbres’). Get-PSResource’ can also be an alias for ‘Get-InstalledPSResource’.
  • There may be now prerelease dependency help. Modules can now take dependencies instantly on prerelease modules within the psd1. This features a change in each publish, and set up (word this isn’t backwards appropriate, within the sense that the change has not been additionally made to install-module).
  • There may be now a -Power parameter to Register-PSResourceRepository cmdlet, to override an current repositories. This lets you take away a verify from scripts to see if the repository already exists earlier than
    making an attempt to register.
  • There are actually priorities on repositories so as to specify a most popular repository {that a} module can be put in from if a module if present in a number of registered repositories.
    Legitimate precedence values vary from 0 to 100. Decrease values have a better precedence rating. The default worth is 50, and might be set at registration or later utilizing the set cmdlet.
    Repositories are sorted by precedence then by title. When looking for sources throughout a number of repositories, the PSResourceGet cmdlets search the repositories utilizing this type order.
  • We added a -TrustRepository swap on Set up-PSResource if you recognize the repository is trusted for a selected name and don’t need to be prompted while not having to set your complete repository to be trusted.

To discover the total cmdlet interface, and have set take a look at the module documentation.

When to make use of PowerShellGet v2/v3

In case you aren’t able to replace your entire scripts to the brand new cmdlets (that may be a giant activity),
PowerShellGet, and the prevailing cmdlet interface, continues to be there so that you can use.

With a view to bridge the hole between PowerShellGet v2 (the present newest steady PowerShellGet is 2.2.5),
and PSResourceGet we introduce a compatibility layer for PSResourceGet and are delivery it as PowerShellGet v3. This module is presently in a preview state and dealing in direction of a GA.

Within the newest preview of PowerShellGet (3.0.22-beta22), the PowerShellGet syntax is similar, however it
is definitely a proxy operate for PSResourceGet and makes use of the brand new engine.
That is to permit customers to benefit from a few of the bug fixes/efficiency enhancements
while not having to replace their scripts, or have scripts unexpectedly break at module or PowerShell replace time.

Given these three modules the present advice could be to make use of PSResourceGet for brand new scripts, or if you wish to benefit from new options and use the latest/most supported model of the module.
If you’ll be able to use prerelease variations, or are keen to check out PowerShellGet v3 (the compat layer), we actually recognize all testing for this so we are able to make modifications earlier than this reaches GA.
As soon as PowerShellGet v3 reaches GA, this is able to be the really helpful model for previous scripts which you’ll not need to replace, however might need to use a extra supported module for (when it comes to bug fixes from the group), and thereby benefit from bug fixes/efficiency updates. Word that PowerShellGet v3 can be centered on backwards compatibility and never adoption of recent options (though there could also be incidental new options).

Lastly, if every part is working completely nice for you on PowerShellGet v2 you’re free to proceed to make use of it. Nothing has modified concerning the extent to which it’s supported.

In PowerShell 7.5 anticipate to see PowerShellGet model incremented to a v3 model.

Future plans for PSResourceGet

We plan to proceed to launch updates to PSResourceGet starting with a patch launch
together with bug fixes that didn’t fairly make the GA timeline and which might be
discovered after launch. Look out for a characteristic launch within the coming months.

To trace progress in direction of these releases, and see what bugs/options are being labored on
use the initiatives characteristic within the PSResourceGet repository.

Easy methods to give suggestions and get help

We can not overstate how helpful consumer suggestions has been within the improvement of this module.

With a view to give suggestions or get help please open points in our GitHub repository.

Particular due to those that made this launch occur

The largest thanks go to the builders who spent a lot time on this module, and took a lot
care to make it an improved consumer expertise:

  • Amber Erickson
  • Anam Navied
  • Aditya Patwardhan

Thanks to our engineering supervisor Steve Lee for his help alongside this entire journey.

Thanks additionally to each Steven Bucher and Michael Greene for taking on as PM throughout
intervals after I needed to step away from work over the past 4 years.

Thanks to Sean Wheeler for his considerate testing, and his important contributions to the module
by writing the documentation.

Thanks to each group member who has examined this module over time, and offered
such beneficial suggestions to form the design.
Particularly, a couple of group members contributions stand out for both contributing code
or the sheer high quality of points they’ve opened, thanks to:

  • @ThomasNieto
  • @FriedrichWeinmann
  • @cansuerdogan
  • @fsackur
  • @hemisphera

This was a group effort– I sit up for seeing the bugs filed and to the following patch launch,
Sydney

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments