Using Azure DevOps Artifact Feed in PowerShell

By Jake Edwards | Wednesday, January 13th, 2021 | Permalink | No Comments

Your Artifact Feed URL can be used as a PackageSource in PowerShell for Install-Package.

Note that the URL provided when pressing Connect to Feed has a v3 when only v2 appears to work at this time.

Credentials can be a Personal Access Token (PAT) with your email and PAT key. Requires Packaging (Read).

  • XXXXX is your Organization Name
  • YYYYY is your Project Name (Project Scoped Only)
  • ZZZZZ is your Feed Name
$credentials = Get-Credentials

Register-PackageSource -Trusted -ProviderName "PowerShellGet" -Name "MyGallery" -Location "https://pkgs.dev.azure.com/XXXXX/YYYYY/_packaging/ZZZZZZ/nuget/v2/" -Credential $credentials

Installing a package from the feed

When installing a specific package, you can pass the same Credentials object as you used above.

Install-Package <PackageName> -Credential $credentials

Leave a comment