我对所有脚本使用 Save-AzureRmProfile
来并行执行 azure 请求。我从auto login to azure with powershell/借用了这个想法
我必须将系统更新到最新版本 (AzureRM > 4),尽管 AzureRmProfile 现在是 AzureRmContext cmdlet,但我仍然无法像以前一样使用它。
场景
打开 PS 控制台并执行
Save-AzureRmContext -Profile (Add-AzureRmAccount) -Path myprofile.json
# List my VMs
Get-AzureRmVm
打开第二个 PS 控制台
Import-AzureRmContext -Path myprofile.json
# List my VMs
Get-AzureRmVm
Get-AzureRmVM : Your Azure credentials have not been set up or have expired, please run Login-AzureRMAccount to set up your Azure credentials.
如何重用我的配置文件以在并行执行中加载?
最佳答案
cmdlet 中存在错误。您无能为力(只能降级)。
关于powershell - 导入保存的 AzureRMContext 仍需要密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44519462/