Skip to content

Instantly share code, notes, and snippets.

@bentaylorwork
Created November 26, 2019 09:34
Show Gist options
  • Save bentaylorwork/115c72689183b2c10bfde77996c468b1 to your computer and use it in GitHub Desktop.
Save bentaylorwork/115c72689183b2c10bfde77996c468b1 to your computer and use it in GitHub Desktop.
$currentContext = Get-AzContext
$azureRmProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
$azureRmProfileClient = [Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient]::new($azureRmProfile)
$azureRmProfileClient.AcquireAccessToken($currentContext.Subscription.TenantId)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment