{"id":20158,"date":"2023-10-09T10:19:07","date_gmt":"2023-10-09T18:19:07","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/powershell\/?p=20158"},"modified":"2025-02-28T12:28:01","modified_gmt":"2025-02-28T20:28:01","slug":"psresourceget-is-generally-available","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/psresourceget-is-generally-available\/","title":{"rendered":"PSResourceGet is generally available"},"content":{"rendered":"<h2>PSResourceGet is Generally Available<\/h2>\n<p>Microsoft.PowerShell.PSResourceGet is a continuation of the PowerShellGet 3.0 project.\nThe module under this new name is now generally available on <a href=\"https:\/\/www.powershellgallery.com\/packages\/Microsoft.PowerShell.PSResourceGet\/\">the PowerShell Gallery<\/a>.<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/powershell\/module\/microsoft.powershell.psresourceget\/?view=powershellget-3.x\">The documentation for PSResourceGet<\/a> is also live.<\/p>\n<h2>How to install the module<\/h2>\n<p>To install from PSResourceGet (which is included since PowerShell 7.4 Preview 5)<\/p>\n<p><code>Install-PSResource -Name Microsoft.PowerShell.PSResourceGet<\/code><\/p>\n<p>To install from PowerShellGet 2.2.5<\/p>\n<p><code>Install-Module -Name Microsoft.PowerShell.PSResourceGet<\/code><\/p>\n<p>With this release we have also included an update to the PowerShell Gallery UI to\nadd a tab in the installation options for PSResourceGet.<\/p>\n<p>This module is supported on all supported versions of PowerShell including Windows PowerShell 5.1.<\/p>\n<h2>Updates from the release candidate<\/h2>\n<p>From the release candidate we addressed high priority low risk bugs, these included:<\/p>\n<ul>\n<li>Fix RequiredResource silent failures<\/li>\n<li>Fix Artifactory v2 and v3 endpoint failures<\/li>\n<li>Fix ADO v2 feed installation failures<\/li>\n<li>Automatically set the ApiVersion to v2 for repositories imported from PowerShellGet<\/li>\n<\/ul>\n<h2>What is PSResourceGet\/what are the goals<\/h2>\n<p>PSResourceGet is a complete re-write of PowerShellGet, the package manager for PowerShell, with the following goals:<\/p>\n<ul>\n<li><em>Create a more intuitive package manager<\/em>: Make PowerShell resource management more intuitive and easier to use by removing unnecessary prompts when possible.<\/li>\n<li><em>Address top customer issues<\/em>: Many of the top customer issues in previous versions of the module have been challenging to resolve because of architecture decisions made early on in the development of PowerShellGet.<\/li>\n<li><em>Allow for a smooth transition to a better experience<\/em>: Transitioning from lower versions of PSResourceGet should be as painless as possible. With the help of our compatibility layer explained in more detail below, our goal is to enable users and scripts built on PowerShellGet 2.0 to move seamlessly to the PSResourceGet engine.<\/li>\n<li><em>Improve maintainability of the codebase<\/em>: This goal is addressed by removing the provider model that PowerShellGet was originally built on.<\/li>\n<\/ul>\n<p>This means that PowerShellGet 3.0 does not take a dependency on OneGet, NuGet or any other package provider therefore simplifying the codebase.<\/p>\n<p>Using the lessons learned from previous versions of PowerShellGet, along with a cleaner implementation and interface, we have improved efficiency, performance and quality, allowing us to more quickly address bugs as they arise and iterate on our vNext issues.<\/p>\n<h3>Why make a whole new module\/why the rename<\/h3>\n<p>When we initially introduced the new project we introduced it as PowerShellGet v3, a major update to PowerShellGet.\nDuring this time we also introduced a new cmdlet interface (Install-PSResource vs Install-Module),\nthis was done for two main reasons:<\/p>\n<ol>\n<li>To simplify the cmdlet interface<\/li>\n<li>The cmdlets now support more than just modules (scripts, nupkgs etc..)<\/li>\n<\/ol>\n<p>In addition to this major breaking change, there were other smaller breaking changes to the\ncmdlet interface made to fix bugs or improve usability.<\/p>\n<p>Given the many breaking changes when we made the decision to ship the new version in PowerShell 7.4,\nthere was concern that we would break folks&#8211; especially those using PowerShellGet cmdlets in CI\/CD or other automation.\nThrough community collaboration we determined that the best path forward was to start fresh with a new\nmodule name, and to introduce PowerShellGet v3 as a compatibility layer to bridge the gap between the\nold cmdlet interface, and the new engine improvements.\nFor more information on how this decision was made read <a href=\"https:\/\/devblogs.microsoft.com\/powershell\/powershellget-in-powershell-7-4-updates\/\">this blog post<\/a>.\nFor more information on when to use which module or how to use PowerShellGet with the new engine via compat layer refer to the &#8216;When to use PowerShellGet v2\/v3&#8217; section below.<\/p>\n<h2>Shipping in PowerShell<\/h2>\n<p>PSResourceGet ships inbox in PowerShell 7.4, side by side with PowerShellGet 2.2.5.\nWe have shipped the last few previews as well as the release candidate for\nPSResourceGet in 7.4 and this has been a great mechanism for usage and feedback.<\/p>\n<p>We are currently exploring options for shipping PSResourceGet inbox in Windows PowerShell 5.1\nif this is an important scenario for you please let us know in <a href=\"https:\/\/github.com\/PowerShell\/PSResourceGet\/issues\/1437\">this GitHub issue<\/a>.<\/p>\n<h2>New Features (compared to PowerShellGet v2)<\/h2>\n<p>In addition to addressing long standing bugs and performance, usability and supportability issues,\nwe also added some new features in PSResourceGet 1.0.0.\nSome of these features include credential persistence, RequiredResource files, and support for more repositories (including nuget v3 repositories).\nFor more information on supported repositories, refer to the section below.<\/p>\n<h3>Credential Persistence<\/h3>\n<p>This community contributed feature allows you to provide information about where a credential is stored when registering the\nPSResourceRepository using a <code>-CredentialInfo<\/code> parameter.\nThis parameter takes a PSCredentialInfo object which takes a Vault name and Secret name.\nThe secret will then be pulled to authenticate to the Repository on future calls.\nThis feature takes advantage of SecretManagement, for more information on SecretManagement refer <a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/microsoft.powershell.secretmanagement\/?view=ps-modules\">the documentation<\/a>.<\/p>\n<h3>Requirements<\/h3>\n<ul>\n<li>Microsoft.PowerShell.SecretManagement<\/li>\n<li>Any vault extension registered (for this example I will use Microsoft.PowerShell.SecretStore)<\/li>\n<li>A repository to connect to (for this example I will use Artifactory)<\/li>\n<\/ul>\n<h3>Getting started<\/h3>\n<p>For this example I am going to be using SecretStore to store my credentials for an Artifactory repository.\nThis can be repeated with any SecretManagement extension vault, and with any repository.\nFirst, I need to make sure I have a SecretManagement vault set up, with my credential stored.<\/p>\n<pre><code>PS C:\\Users &gt; Get-SecretInfo\r\nName          Type         VaultName\r\n----          ----         ---------\r\njFrogCred     PSCredential SecretStore<\/code><\/pre>\n<p>Then I can create a PSCredentialInfo object to pass into my PSResourceRepository registration, to create this I pass in the name of the vault and the name of the secret.<\/p>\n<pre><code>$credentialInfo = New-Object Microsoft.PowerShell.PSResourceGet.UtilClasses.PSCredentialInfo (\"SecretStore\", \"jfrogCred\")<\/code><\/pre>\n<p>Now I am ready to register the repository object, I will pass in a friendly name, a URI for the repository, and the CredentialInfo. I also use the <code>-Trusted<\/code> switch because I will be controlling what gets published to it.<\/p>\n<pre><code>Register-PSResourceRepository -Name artifactory `\r\n-URI \" https:\/\/&lt;name&gt;.jfrog.io\/artifactory\/api\/nuget\/v3\/&lt;Repository-Name&gt;\r\n-Trusted `\r\n-CredentialInfo $credentialInfo `<\/code><\/pre>\n<p>Now I can run <code>Get-PSResourceRepository<\/code> to see my registered repositories<\/p>\n<pre><code>PS C:\\Users &gt; Get-PSResourceRepository\r\n\r\nName        Uri                                                                                     Trusted Priority\r\n----        ---                                                                                     ------- --------\r\nartifactory https:\/\/&lt;name&gt;.jfrog.io\/artifactory\/api\/nuget\/v3\/&lt;Repository-Name&gt;                      True    50      \r\nPSGallery   https:\/\/www.powershellgallery.com\/api\/v2                                                False   50  <\/code><\/pre>\n<p>If the repository is empty you are going to want to begin by publishing to it. I have saved my API key for publishing to the repository in my SecretStore.<\/p>\n<pre><code>Publish-PSResource -Path .\\Get-Hello\\ -Repository artifactory -ApiKey (Get-Secret jfrogPublish)<\/code><\/pre>\n<p>Now I can find and install PSResources from my repository without needing to provide a credential at each call.<\/p>\n<pre><code>PS C:\\Users&gt; Find-PSResource -Name Get-Hello -Repository artifactory\r\n\r\nName      Version Prerelease Repository  Description\r\n----      ------- ---------- ----------  -----------\r\nGet-Hello 0.0.2.0            artifactory test module\r\n\r\nPS C:\\Users&gt; Install-PSResource Get-Hello<\/code><\/pre>\n<h3>Using RequiredResources<\/h3>\n<p>Install-PSResource can accept a path to a psd1 or json file (using -RequiredResourceFile), or a hashtable or json (using -RequiredResource).<\/p>\n<h3>Getting Started<\/h3>\n<p>The <code>-RequiredResource<\/code> parameter can take either a hashtable or a json format string.\nThe following example shows how to format these inputs.<\/p>\n<pre><code>Install-PSResource -RequiredResource @{\r\n  'Configuration' = @{\r\n    version = '[1.3.1,2.0]'\r\n    repository = 'PSGallery'                        \r\n   }\r\n  'Pester'        = @{\r\n    version = '[4.4.2,4.7.0]'\r\n    repository = 'PSGallery'\r\n    prerelease = $true\r\n  }\r\n}<\/code><\/pre>\n<p>In this case the modules named &#8220;Configuration&#8221;, and &#8220;Pester&#8221; will be installed.\nThe json format will be the same as if this hashtable is passed to ConvertTo-Json:<\/p>\n<pre><code>\"{\r\n  'Pester': {\r\n    'allowPrerelease': true,\r\n    'version': '[4.4.2,4.7.0]',\r\n    'repository': 'PSGallery'\r\n  },\r\n  'Configuration': {\r\n    'version': '[1.3.1,2.0]',\r\n    'repository': 'PSGallery'\r\n  }\r\n}\"<\/code><\/pre>\n<p>The older System.Version four part version type will be supported to retain compatibility with existing published modules using that format.\nDeclared dependencies are searched and installed using the same trust algorithm as for Install-PSResource.<\/p>\n<p>The <code>-RequiredResourceFile<\/code> parameter can accept either a psd1 or a json file.\nThe psd1 should use the same format as the hashtable above, the json file should use the same\nformat as the json sting above.<\/p>\n<h3>Supported Repositories<\/h3>\n<p>In this release we made an effort to support repositories which previously worked\nwith PowerShellGet as well as add support for new repositories.<\/p>\n<ul>\n<li>NuGet.org<\/li>\n<li>NuGet.Server feeds<\/li>\n<li>Azure Artifacts (v2 and v3)<\/li>\n<li>GitHub packages<\/li>\n<li>Artifactory (v2 and v3 feeds)<\/li>\n<li>MyGet.org<\/li>\n<li>File-share-based<\/li>\n<\/ul>\n<p>For more information on how to get started with these repositories, check out <a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/gallery\/powershellget\/supported-repositories?view=powershellget-3.x\">our documentation<\/a>.<\/p>\n<p>If a repository you use is not on this list, and does not work with\nyour testing please file an issue and let us know.\nIf issues asking for new repository support get enough community support\nwe will consider adding support.<\/p>\n<p>Expect to see new repositories and repository types added to this list in the future.<\/p>\n<p>In order to import your repositories from PowerShellGet run the function <code>Import-PSGetRepository<\/code>.<\/p>\n<h3>Other handy features to know about<\/h3>\n<ul>\n<li>You can install to a local path by using <code>Save-PSResource<\/code> with the <code>-IncludeXML<\/code> parameter.\nNote that if you do this you will need to import the module manually or add the path to your\nPSModulePath environment variable so it can be detected by the PowerShell module import system.<\/li>\n<li>You can use aliases for Install-PSResource, Find-PSResource, Update-PSResource, Publish-PSResource (\u2018isres\u2019,\u2019fdres\u2019,\u2019udres\u2019,\u2019pbres\u2019). Get-PSResource\u2019 is also an alias for \u2018Get-InstalledPSResource\u2019.<\/li>\n<li>There is now prerelease dependency support. Modules can now take dependencies directly on prerelease modules in the psd1. This includes a change in both publish, and install (note this isn&#8217;t backwards compatible, in the sense that the change has not been also made to install-module).<\/li>\n<li>There is now a -Force parameter to Register-PSResourceRepository cmdlet, to override an existing repositories. This allows you to remove a check from scripts to see if the repository already exists before\nattempting to register.<\/li>\n<li>There are now priorities on repositories so that you can specify a preferred repository that a module will be installed from if a module if found in multiple registered repositories.\nValid priority values range from 0 to 100. Lower values have a higher priority ranking. The default value is 50, and can be set at registration or later using the set cmdlet.\nRepositories are sorted by priority then by name. When searching for resources across multiple repositories, the PSResourceGet cmdlets search the repositories using this sort order.<\/li>\n<li>We added a <code>-TrustRepository<\/code> switch on Install-PSResource if you know the repository is trusted for a particular call and do not want to be prompted without needing to set the entire repository to be trusted.<\/li>\n<\/ul>\n<p>To explore the full cmdlet interface, and feature set check out <a href=\"https:\/\/learn.microsoft.com\/powershell\/module\/microsoft.powershell.psresourceget\/?view=powershellget-3.x\">the module documentation<\/a>.<\/p>\n<h2>When to use PowerShellGet v2\/v3<\/h2>\n<p>If you aren&#8217;t ready to update all of your scripts to the new cmdlets (that can be a big task),\nPowerShellGet, and the existing cmdlet interface, is still there for you to use.<\/p>\n<p>In order to bridge the gap between PowerShellGet v2 (the current latest stable PowerShellGet is 2.2.5),\nand PSResourceGet we introduce a compatibility layer for PSResourceGet and are shipping it as PowerShellGet v3. This module is currently in a preview state and working towards a GA.<\/p>\n<p>In the latest preview of <a href=\"https:\/\/www.powershellgallery.com\/packages\/PowerShellGet\/3.0.22-beta22\">PowerShellGet (3.0.22-beta22)<\/a>, the PowerShellGet syntax is the same, but it\nis actually a proxy function for PSResourceGet and uses the new engine.\nThis is to allow users to take advantage of some of the bug fixes\/performance improvements\nwithout needing to update their scripts, or have scripts unexpectedly break at module or PowerShell update time.<\/p>\n<p>Given these three modules the current recommendation would be to use PSResourceGet for new scripts, or if you want to take advantage of new features and use the newest\/most supported version of the module.\nIf you are able to use prerelease versions, or are willing to test out PowerShellGet v3 (the compat layer), we really appreciate all testing for this so we can make changes before this reaches GA.\nOnce PowerShellGet v3 reaches GA, this would be the recommended version for old scripts which you may not want to update, but may want to use a more supported module for (in terms of bug fixes from the team), and thereby take advantage of bug fixes\/performance updates. Note that PowerShellGet v3 will be focused on backwards compatibility and not adoption of new features (although there may be incidental new features).<\/p>\n<p>Finally, if everything is working totally great for you on PowerShellGet v2 you are free to continue to use it. Nothing has changed about the extent to which it is supported.<\/p>\n<p>In PowerShell 7.5 expect to see PowerShellGet version incremented to a v3 version.<\/p>\n<h2>Future plans for PSResourceGet<\/h2>\n<p>We plan to continue to release updates to PSResourceGet beginning with a patch release\nincluding bug fixes that didn&#8217;t quite make the GA timeline and that are\nfound after release. Look out for a feature release in the coming months.<\/p>\n<p>To track progress towards these releases, and see what bugs\/features are being worked on\nuse the <a href=\"https:\/\/github.com\/PowerShell\/PSResourceGet\/projects?type=classic\">projects feature in the PSResourceGet repository<\/a>.<\/p>\n<h2>How to give feedback and get support<\/h2>\n<p>We cannot overstate how useful user feedback has been in the development of this module.<\/p>\n<p>In order to give feedback or get support please open issues in our <a href=\"https:\/\/github.com\/powershell\/psresourceget\">GitHub repository<\/a>.<\/p>\n<h2>Special thanks to those who made this release happen<\/h2>\n<p>The biggest thanks go to the developers who spent so much time on this module, and took so much\ncare to make it an improved user experience:<\/p>\n<ul>\n<li>Amber Erickson<\/li>\n<li>Anam Navied<\/li>\n<li>Aditya Patwardhan<\/li>\n<\/ul>\n<p>Thank you to our engineering manager Steve Lee for his support along this whole journey.<\/p>\n<p>Thank you also to both Steven Bucher and Michael Greene for taking over as PM during\nperiods when I had to step away from work over the last four years.<\/p>\n<p>Thank you to Sean Wheeler for his thoughtful testing, and his essential contributions to the module\nby writing the documentation.<\/p>\n<p>Thank you to every community member who has tested this module over the years, and provided\nsuch valuable feedback to shape the design.\nIn particular, a few community members contributions stand out for either contributing code\nor the sheer quality of issues they have opened, thank you to:<\/p>\n<ul>\n<li>@ThomasNieto<\/li>\n<li>@FriedrichWeinmann<\/li>\n<li>@cansuerdogan<\/li>\n<li>@fsackur<\/li>\n<li>@hemisphera<\/li>\n<\/ul>\n<p>This was a community effort&#8211; I look forward to seeing the bugs filed and to the next patch release,\nSydney<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PSResourceGet is generally available<\/p>\n","protected":false},"author":2299,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[274,3199],"class_list":["post-20158","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-powershellget","tag-psresourceget"],"acf":[],"blog_post_summary":"<p>PSResourceGet is generally available<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/20158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/2299"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=20158"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/20158\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=20158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=20158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=20158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}