You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write-Error-Message ('Deletion of VM Image with publisher "{0}", offer "{1}", sku "{2}" failed with Error:"{3}.'-f$publisher,$offer,$sku,$Error) -ErrorAction Stop
347
+
}
348
+
}
339
349
}
340
350
}
341
-
catch{
342
-
Write-Error-Message ('Deletion of VM Image with publisher "{0}", offer "{1}", sku "{2}" failed with Error:"{3}.'-f$publisher,$offer,$sku,$Error) -ErrorAction Stop
343
-
}
344
351
345
352
if(-not$KeepMarketplaceItem){
346
353
Write-Verbose"Removing the marketplace item for the VM Image."-Verbose
@@ -559,7 +566,7 @@ function New-Server2016VMImage {
559
566
560
567
#Pre-validate that the VM Image is not already available
561
568
$VMImageAlreadyAvailable=$false
562
-
if (Get-AzureRmVMImage-Location$PublishArguments.location-PublisherName$PublishArguments.publisher-Offer $PublishArguments.offer-Skus $sku-Version $PublishArguments.version-ErrorAction SilentlyContinue) {
Copy file name to clipboardExpand all lines: Connect/AzureStack.Connect.psm1
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,8 @@ function Add-AzureStackAzureRmEnvironment {
104
104
}
105
105
}
106
106
107
+
$ArmEndpoint=$ArmEndpoint.TrimEnd("/")
108
+
107
109
$Domain=""
108
110
try {
109
111
$uriARMEndpoint= [System.Uri] $ArmEndpoint
@@ -357,6 +359,14 @@ function Get-AzureStackAdminSubTokenHeader {
357
359
$ARMEndpoint='https://'+$ARMEndpoint
358
360
}
359
361
}
362
+
363
+
$ArmEndpoint=$ArmEndpoint.TrimEnd("/")
364
+
365
+
try{
366
+
Invoke-RestMethod-Method Get -Uri "$($ARMEndpoint.ToString().TrimEnd('/'))/metadata/endpoints?api-version=2015-01-01"-ErrorAction Stop |Out-Null
367
+
}catch{
368
+
Write-Error"The specified ARM endpoint: $ArmEndpoint is not valid for this environment. Please make sure you are using the correct administrator ARM endpoint for this environment."-ErrorAction Stop
369
+
}
360
370
361
371
$Domain=""
362
372
try {
@@ -380,7 +390,13 @@ function Get-AzureStackAdminSubTokenHeader {
Write-Error"Verify that the login credentials are for the administrator and that the specified ARM endpoint: $ArmEndpoint is the valid administrator ARM endpoint for this environment."-ErrorAction Stop
0 commit comments