This repository was archived by the owner on Sep 27, 2019. It is now read-only.
File tree 2 files changed +13
-6
lines changed
PSSwagger/PSSwagger.Azure.Helpers
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,15 @@ function Get-AzSubscriptionId
47
47
[CmdletBinding ()]
48
48
param ()
49
49
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
+ }
52
59
}
53
60
54
61
function Get-AzResourceManagerUrl
Original file line number Diff line number Diff line change @@ -99,13 +99,13 @@ $autoRestInstallPath = Split-Path -Path $autoRestModule.Source
99
99
$executeTestsCommand += " ;`$ env:Path+=`" ;$autoRestInstallPath \tools`" "
100
100
101
101
# AzureRM.Profile requirement
102
- $azureRmProfile = Get-Package AzureRM.Profile - ErrorAction Ignore
102
+ $azureRmProfile = Get-Package - Name AzureRM.Profile - Provider PowerShellGet - ErrorAction Ignore
103
103
if (-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
106
106
}
107
107
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' }
109
109
}
110
110
111
111
$powershellFolder = $null
You can’t perform that action at this time.
0 commit comments