This repository was archived by the owner on Sep 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
PSSwagger/PSSwagger.Azure.Helpers Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,15 @@ function Get-AzSubscriptionId
4747 [CmdletBinding ()]
4848 param ()
4949
50- $AzureContext = & " $moduleName \Get-AzureRmContext" - ErrorAction Stop
51- $AzureContext.Subscription.SubscriptionId
50+ $AzureContext = & " $moduleName \Get-AzureRmContext" - ErrorAction Stop
51+ if (Get-Member - InputObject $AzureContext.Subscription - Name SubscriptionId)
52+ {
53+ return $AzureContext.Subscription.SubscriptionId
54+ }
55+ else
56+ {
57+ return $AzureContext.Subscription.Id
58+ }
5259}
5360
5461function Get-AzResourceManagerUrl
Original file line number Diff line number Diff line change @@ -99,13 +99,13 @@ $autoRestInstallPath = Split-Path -Path $autoRestModule.Source
9999$executeTestsCommand += " ;`$ env:Path+=`" ;$autoRestInstallPath \tools`" "
100100
101101# AzureRM.Profile requirement
102- $azureRmProfile = Get-Package AzureRM.Profile - ErrorAction Ignore
102+ $azureRmProfile = Get-Package - Name AzureRM.Profile - Provider PowerShellGet - ErrorAction Ignore
103103if (-not $azureRmProfile ) {
104- if (-not (Get-PackageSource PSGallery - ErrorAction Ignore)) {
105- Register-PackageSource PSGallery - ProviderName PowerShellGet
104+ if (-not (Get-PackageSource - Name PSGallery - ErrorAction Ignore)) {
105+ Register-PackageSource - Name PSGallery - ProviderName PowerShellGet
106106 }
107107
108- $azureRmProfile = Install-Package AzureRM.Profile - Source PSGallery - RequiredVersion 2.8 . 0 - Force | Where-Object { $_.Name -eq ' AzureRM.Profile' }
108+ $azureRmProfile = Install-Package - Name AzureRM.Profile - Provider PowerShellGet - Source PSGallery - Force | Where-Object { $_.Name -eq ' AzureRM.Profile' }
109109}
110110
111111$powershellFolder = $null
You can’t perform that action at this time.
0 commit comments