Skip to content

Commit ab4f309

Browse files
authored
Sync eng/common directory with azure-sdk-tools repository (#11387)
1 parent f053a44 commit ab4f309

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

eng/common/scripts/artifact-metadata-parsing.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function IsMavenPackageVersionPublished($pkgId, $pkgVersion, $groupId) {
113113
try {
114114

115115
$uri = "https://oss.sonatype.org/content/repositories/releases/$groupId/$pkgId/$pkgVersion/$pkgId-$pkgVersion.pom"
116-
$pomContent = Invoke-WebRequest-WithHandling -Method "GET" -url $uri
116+
$pomContent = Invoke-RestMethod -MaximumRetryCount 3 -Method "GET" -uri $uri
117117

118118
if ($pomContent -ne $null -or $pomContent.Length -eq 0) {
119119
return $true
@@ -239,7 +239,7 @@ function IsNugetPackageVersionPublished($pkgId, $pkgVersion) {
239239
$nugetUri = "https://api.nuget.org/v3-flatcontainer/$($pkgId.ToLowerInvariant())/index.json"
240240

241241
try {
242-
$nugetVersions = Invoke-WebRequest-WithHandling -url $nugetUri -Method "GET"
242+
$nugetVersions = Invoke-RestMethod -MaximumRetryCount 3 -uri $nugetUri -Method "GET"
243243

244244
return $nugetVersions.versions.Contains($pkgVersion)
245245
}
@@ -314,7 +314,7 @@ function ParseCArtifact($pkg, $workingDirectory) {
314314
# Returns the pypi publish status of a package id and version.
315315
function IsPythonPackageVersionPublished($pkgId, $pkgVersion) {
316316
try {
317-
$existingVersion = (Invoke-WebRequest-WithHandling -Method "Get" -url "https://pypi.org/pypi/$pkgId/$pkgVersion/json").info.version
317+
$existingVersion = (Invoke-RestMethod -MaximumRetryCount 3 -Method "Get" -uri "https://pypi.org/pypi/$pkgId/$pkgVersion/json").info.version
318318

319319
# if existingVersion exists, then it's already been published
320320
return $True

0 commit comments

Comments
 (0)