Created
May 27, 2020 08:58
-
-
Save mikeblakeuk/7436c4861e363b135a492ea34c74eb66 to your computer and use it in GitHub Desktop.
Refresh the DevOps NuGet Arifact feeds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#based on - https://dev.to/omiossec/getting-started-with-azure-devops-api-with-powershell-59nn | |
$feedname = "central" | |
$PackageName = "MyNew.Package" | |
$PackageVersion = "1.0.1-preview" | |
$AzureDevOpsPAT = "YOUR PAT" # Ideally use the az Nuget Creditials provider. | |
$OrganizationName = "MyOrg" | |
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($AzureDevOpsPAT)")) } | |
$uri = "https://pkgs.dev.azure.com/$($OrganizationName)/_apis/packaging/feeds/$($feedname)/nuget/packages/$($PackageName)/versions/$($PackageVersion)/content?api-version=5.0-preview.1" | |
$uri | |
Invoke-RestMethod -Uri $uri -Method Head -Headers $AzureDevOpsAuthenicationHeader | |
Invoke-RestMethod -Uri $uri -Method Get -Headers $AzureDevOpsAuthenicationHeader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all! This shouldn't be needed any more. We're updating the docs to reflect greatly improved refresh speed.