June 9th, 2023

PSResourceGet Preview is Now Available

Microsoft.PowerShell.PSResourceGet is a continuation of the PowerShellGet 3.0 project. The first preview release of this module under the new name is now available on the PowerShell Gallery. This release contains the module rename, and reintroduces support for Azure Artifacts, GitHub packages, and Artifactory and contains a number of bug fixes.

How to install the module

To install from PowerShellGet 3.0 previews

Install-PSResource Microsoft.PowerShell.PSResourceGet -Prerelease

To install from PowerShellGet 2.2.5

Install-Module -Name Microsoft.PowerShell.PSResourceGet -AllowPrerelease

Note that once you install this module you will need to re-register your repositories as the repository registration file has moved.

What is included in this preview

Breaking Changes

  • PowerShellGet is now PSResourceGet
  • Update-PSScriptFile is now Update-PSScriptFileInfo
  • New-PSScriptFile is now New-PSScriptFileInfo
  • Update-ModuleManifest is now Update-PSModuleManifest
  • -Tags parameter changed to -Tag in New-PSScriptFile, Update-PSScriptFileInfo, and Update-ModuleManifest
  • Change the type of -InputObject from PSResourceInfo to PSResourceInfo[] for Install-PSResource, Save-PSResource, and Uninstall-PSResource
  • PSModulePath is no longer referenced when searching paths

New Features

  • Support for Azure Artifacts, GitHub Packages, and Artifactory

Bug Fixes

  • Filter out unlisted packages
  • Add paging for V3 server requests
  • Support for floating versions
  • Update, Save, and Install with wildcard gets the latest version within specified range
  • Add positonal parameter for -Path in Publish-PSResource
  • Uninstall-PSResource -WhatIf now shows version and path of package being uninstalled
  • Find returns packages from the highest priority repository only
  • Bug fix for PSCredentialInfo constructor
  • Bug fix for Install-PSResource -NoClobber parameter
  • Save-PSResource now searches through all repos when no repo is specified
  • Caching for improved performance in Uninstall-PSResource
  • Bug fix for parsing package tags for packages that only have .nuspec from local repository

Getting started with various v3 feeds

Nuget Gallery

To register run Register-PSResourceRepository -Name "NuGetGallery" -Uri "https://api.nuget.org/v3/index.json"

No credentials are required for this repository.

Azure DevOps Feeds

To get the uri for your feed go to dev.azure.com > Artifacts > select desired feed > click “Connect to Feed” > choose “NuGet.exe”. then runRegister-PSResourceRepository -Name "AdoFeedName" -Uri <My_ADO_Feed_Uri> If it is a public feed creds arent needed. If it is a private feed go to dev.azure.com > User Settings in top right corner > Personal Access Tokens > Create PAT token. In your PowerShell terminal, create credential with your username as your email account used for ADO, password will be PAT token from prior step. To use the credential persistence feature of PSResourceGet reference the docs. You can also use with the -CredentialInfo parameter.

GitHub Packages

To register your feed run Register-PSResourceRepository -Name "GithubPackagesFeed" -Uri "https://nuget.pkg.github.com/<NAMESPACE>/index.json" Where is either the name of your account or your organization. For instructions on how to authenticate to your GitHub packages feed reference the documentation here. To use the credential persistence feature of PSResourceGet reference the docs. You can also use with the -CredentialInfo parameter.

Artifactory

To register your repository run Register-PSResourceRepository -Name "JFrogFeed" -Uri "https://<myaccount>.jfrog.io/artifactory/api/nuget/v3/<myrepository>/index.json" Credentials are required for this repository, the website UI will guide you to create a PAT token. In the pwsh terminal, create credential where the username will be your email account used for artifactory, password will be PAT token from prior step. To use the credential persistence feature of PSResourceGet reference the docs. You can also use with the -CredentialInfo parameter.

Versioning of this module

This first preview of PSResourceGet is a continuation of the previous 21 previews of PowerShellGet 3.0. We versioned this first preview as 0.5.22-beta22. When determing this version we took into consideration semantic versioning (semver), how PowerShell does versioning, versioning patterns we were inheriting from PowerShellGet, and how to best communicate the state of the module. We want PSResourceGet go GA with a 1.0.0 release and follow semver versioning from there. In the meantime we wanted to reflect that this release is nearing RC state and is the continuation of previous 21 previews. To accomplish both of these goals we comprimised on a version of 0.5.22-beta22.

Roadmap to GA

We expect this release to ship in the next preview of PowerShell 7.4. Given that we are shipping in PowerShell 7.4 we intend to GA before the GA of PowerShell 7.4 which is targeted for this fall. The current plan is to have one more preview release of PSResourceGet and then release a release candidate (RC). From there we will evaluate readiness for GA.

Next Steps for PowerShellGet

The module formally known as CompatPowerShellGet will now ship as PowerShellGet v3. This module serves as a compatibility layer to use v2 syntax which calls PSResourceGet as the engine. The next preview of PowerShellGet v3 will be this compatibility layer, and take a dependency on PSResourceGet.

How to give feedback and Get Support

We cannot overstate how critical user feedback is at this stage in the development of the module. Feedback from preview releases help inform design decisions without incurring a breaking change once generally available and used in production.

In order to help us to make key decisions around the behavior of the module please give us feedback by opening issues in our GitHub repository.

Sydney

PowerShell Team

Author

PM on the PowerShell team at Microsoft.

0 comments

Discussion are closed.