我正在尝试创建用户分配的身份,文档说 6.13 应该包括这个功能:https://learn.microsoft.com/en-us/powershell/module/azurerm.managedserviceidentity/new-azurermuserassignedidentity?view=azurermps-6.13.0
我卸载了旧版本的 Azure RM 并安装了最新版本:
PS C:\Users\user> Get-Module AzureRM -ListAvailable | Select-Object -Property Name,Version,Path
Name Version Path
---- ------- ----
AzureRM 6.13.1 C:\Program Files\WindowsPowerShell\Modules\AzureRM\6.13.1\AzureRM.psd1
但是当我尝试使用它时,出现以下错误:
PS C:\Users\zakima> New-AzureRmUserAssignedIdentity -ResourceGroupName PSRG -Name ID1
New-AzureRmUserAssignedIdentity : The term 'New-AzureRmUserAssignedIdentity' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ New-AzureRmUserAssignedIdentity -ResourceGroupName PSRG -Name ID1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-AzureRmUserAssignedIdentity:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我是否缺少某些配置设置?
最佳答案
New-AzureRmUserAssignedIdentity
Cmdlet 位于 AzureRM.ManagedServiceIdentity
模块中。该模块又可以在 PowerShell Gallery 中找到并且可以通过以下方式安装:
Install-Module -Name "AzureRM.ManagedServiceIdentity" -AllowPrerelease
请注意,Install-Module
的 AllowPrerelease
标志可能不适用于您安装的 PowerShellGet
版本,因此您可能需要更新它在上述工作之前:
Install-Module "PowerShellGet" –Repository "PSGallery" –Force
关于powershell - 术语 'New-AzureRmUserAssignedIdentity' 未被识别为名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54706538/