File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ function Sync-AzSOfflineMarketplaceItems{
5757 $registration = $registrations [0 ]
5858
5959 # Retrieve the access token
60- $tokens = [Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache ]::DefaultShared .ReadItems()
60+ $tokens = [Microsoft.Azure.Commands.Common.Authentication.AzureSession ]::Instance.TokenCache .ReadItems()
6161 $token = $tokens | Where Resource -EQ $azureEnvironment.ActiveDirectoryServiceEndpointResourceId | Where DisplayableId -EQ $azureAccount.Context.Account.Id | Sort ExpiresOn | Select - Last 1
6262
6363
@@ -132,10 +132,17 @@ $Marketitems|Out-GridView -Title 'Azure Marketplace Items' -PassThru|foreach{
132132 # download azpkg
133133 $azpkgsource = $downloadDetails.galleryPackageBlobSasUri
134134 $FileExists = Test-Path " $destination \$azpkgName .azpkg"
135+ $DestinationCheck = Test-Path $destination
136+ If ($DestinationCheck -eq $false )
137+ {
138+ new-item - ItemType Directory - force $destination } else {}
139+
135140 If ($FileExists -eq $true ) {Remove-Item " $destination \$azpkgName .azpkg" - force} else {
136141 New-Item " $destination \$azpkgName .azpkg" }
137142 $azpkgdestination = " $destination \$azpkgName .azpkg"
138143 Start-BitsTransfer - source $azpkgsource - destination $azpkgdestination - Priority High
144+
145+
139146
140147 # download vhd
141148 $vhdName = $productDetails.properties.galleryItemIdentity
You can’t perform that action at this time.
0 commit comments