Skip to content

Commit 55dd98f

Browse files
bganapaknithinc
authored andcommitted
Handing a breaking change in Get-AzureRmResource (#470)
1 parent a5cb84c commit 55dd98f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Syndication/AzureStack.MarketplaceSyndication.psm1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ function Sync-AzSOfflineMarketplaceItem {
3737

3838
$resources = Get-AzureRmResource
3939
$resource = $resources.resourcename
40+
# workaround for a breaking change from moving from profile version 2017-03-09-profile to 2018-03-01-hybrid
41+
# the output model of Get-AzureRmResource has changed between these versions
42+
# in future this code path can be changed to simply with (Get-AzureRMResource -Name "AzureStack*").Name
43+
if($resource -eq $null)
44+
{
45+
$resource = $resources.Name
46+
}
47+
4048
$registrations = $resource|where-object {$_ -like "AzureStack*"}
4149
if ($registrations.count -gt 1) {
4250
$Registration = $registrations[0]

0 commit comments

Comments
 (0)