从AZRm模块到Az模块的隐蔽

问题描述

我想将过时的AzRm模块代码替换为Az模块代码。谁能帮我吗?

 [cmdletbinding()]
        param()
    
        $currentAzureContext = Get-AzContext
    
        $azureRmProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
        $profileClient = New-Object Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient($azureRmProfile)
        
        Write-Verbose ("Tenant: {0}" -f  $currentAzureContext.Subscription.Name)
        
        $token = $profileClient.AcquireAccesstoken($currentAzureContext.Tenant.TenantId)
        $token.Accesstoken

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)