我正在尝试通过 New-AzManagementGroup 命令在 Azure 中创建一个新的管理组,但总是出错。我尝试了许多不同的方法,但没有一个有效。
PS /home/divyansh> $parent = Get-AzManagementGroup -GroupId "MI-Test"
$parent
Id : /providers/Microsoft.Management/managementGroups/MI-Test
Type : /providers/Microsoft.Management/managementGroups
Name : MI-Test
TenantId : xxxxxxxxxxxxxxxxxxxxx
DisplayName : MI-Test
UpdatedTime : 6/15/2021 12:34:00 PM
UpdatedBy : xxxxxxxxxxxxxxxxxxxxx
ParentId : /providers/Microsoft.Management/managementGroups/601SubGroup
ParentName : 601SubGroup
ParentDisplayName : Cloud Customers
PS /home/divyansh> New-AzManagementGroup -GroupId "MI-Test-testing00" -ParentId $parent.Id
New-AzManagementGroup: Unable to cast object of type 'Microsoft.Azure.Management.ManagementGroups.Models.ManagementGroup' to type 'Newtonsoft.Json.Linq.JObject'.
我也尝试了以下命令,但仍然遇到相同的错误。
New-AzManagementGroup -GroupId "MI-Test-testing00" -ParentObject $parent
New-AzManagementGroup: Unable to cast object of type 'Microsoft.Azure.Management.ManagementGroups.Models.ManagementGroup' to type 'Newtonsoft.Json.Linq.JObject'.
寻求帮助。
谢谢, 分