Thursday, May 2, 2024
HomePowershellPSResourceGet help for Azure Container Registry (ACR) is in Preview

PSResourceGet help for Azure Container Registry (ACR) is in Preview


Microsoft.PowerShell.PSResourceGet 1.1.0-preview1 is now out there on the PowerShell Gallery.

This preview provides help for Azure Container Registry (ACR) as a personal repository for PowerShell.
Though ACR is a container registry by identify, on this launch we add help for PowerShell assets as modules, scripts and DSC assets to be immediately revealed and consumed within the repository.
To help this we publish the PowerShell assets as OCIArtifacts, and created a reliable schema to retailer the wanted PSResource metadata.

The documentation for PSResourceGet can also be up to date to mirror this launch.

Easy methods to set up the module

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

Set up-PSResource -Title Microsoft.PowerShell.PSResourceGet -Prerelease

To put in from PowerShellGet 2.2.5

Set up-Module -Title Microsoft.PowerShell.PSResourceGet -AllowPrerelease

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

Updates on this launch

New Options

  • Assist for Azure Container Registries

Bug Fixes

  • Repair incorrect request URL when putting in assets from ADO (Thanks @anytonyoni!)
  • Repair for swallowed exceptions
  • Repair for PSResourceGet not working in Constrained Language Mode

Getting began with ACR

Azure Container Registry (ACR) means that you can construct, retailer, and handle container pictures and artifacts in a personal registry for all sorts of container deployments.
ACR-based repositories are non-public repositories and require credentials for entry.
To create a registry confer with this documentation.

To register an ACR repository, you should know the LoginServer identify of the ACR. Use the next instructions to register an ACR repository as a PSResource repository.

$myAcr = Get-AzContainerRegistry -Title myAcr
$acrUrl = "https://$($myAcr.LoginServer)"
Register-PSResourceRepository -Title ACRDemoRepo -Uri $acrUrl

After you register the repository, the primary time you carry out an operation on the registered repository in a brand new session you might be prompted to login.
This repository makes use of the Azure.Identification SDK for authentication.

When you register, you may publish to the repository, word you’ll not want to make use of
an API key.
For PowerShell assets to be discoverable/installable by PSResourceGet they are going to have to be revealed by PSResourceGet,
it is because the module codecs the metadata in a selected approach through the publish course of to ACR.

$publishPSResourceSplat = @{
    Path="D:MyModule"
    Repository = 'ACRDemoRepo'
}
Publish-PSResource @publishPSResourceSplat

Now you can work together with the repository utilizing discover/set up instructions
as you’ll with different repositories.

Please word the constraints of container registries.

For extra detailed info take a look at the documentation.

Easy methods to give suggestions and get help

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

As a way to give suggestions or get help please open points in our GitHub repository.

Sydney

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments