Powershell 新AzureRmVM:无法使用指定的命名参数解析参数集

Powershell 新AzureRmVM:无法使用指定的命名参数解析参数集,powershell,azure,azure-powershell,Powershell,Azure,Azure Powershell,我是Powershell的新手,正在运行以下脚本并获得主题行中提到的错误: $LocationName = "West Europe" $VNet_ResourceGroupName = "Mydeveloper_resource_group" $VM_ResourceGroupName = "MyDeveloperResourceGroup" $PublicIpAddress = "[]" $PrivateIpAddress = "10.199.120.30" $VirtualNetwork

我是Powershell的新手,正在运行以下脚本并获得主题行中提到的错误:

$LocationName = "West Europe"
$VNet_ResourceGroupName = "Mydeveloper_resource_group"
$VM_ResourceGroupName = "MyDeveloperResourceGroup"
$PublicIpAddress = "[]"
$PrivateIpAddress = "10.199.120.30" 
$VirtualNetworkName = "developer_vnet"
$SubnetName = "MySubnet"
$SubnetId = "/subscriptions/....../resourceGroups/developer_resource_group/providers/Microsoft.Network/virtualNetworks/developer_vnet/subnets/MySubnet"
$VMName = "AWE4DVM022"
$VMSize = "Standard_D4s_v3"
$AllocationMethod = "Static"
$ImageId = "/subscriptions/................................./resourceGroups/MyIMAGELIBRARY/providers/Microsoft.Compute/images/developer-desktop-image-...................." 

$cred = Get-Credential -Message "Type the name and password of the local administrator account."

$nic = New-AzureRmNetworkInterface -Name TestNIC -ResourceGroupName $VM_ResourceGroupName -Location $LocationName -SubnetId $SubnetId -PrivateIpAddress $PrivateIpAddress

$vm = New-AzureRmVMConfig -VMName $VMName -VMSize $VMSize

$vm = Set-AzureRmVMOperatingSystem -VM $vm -Linux -ComputerName $VMName -Credential $cred

$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nic.Id 

New-AzureRmVM -ResourceGroupName $VM_ResourceGroupName -ImageName $ImageId -VM $vm

Powershell具有参数集的概念。当调用使用参数集的脚本、函数或commandlet时(就像新的AzureRMVM一样),不能为不同集中的参数传递参数。例如
ResourceGroupName
位于参数集1、2和3中
ImageName
位于参数集1中,
VM
位于参数集2中。Powershell无法找出要使用的集合,因为
ImageName
在一个集合中,而
VM
在另一个集合中。

Powershell具有此参数集合的概念。当调用使用参数集的脚本、函数或commandlet时(就像新的AzureRMVM一样),不能为不同集中的参数传递参数。例如
ResourceGroupName
位于参数集1、2和3中
ImageName
位于参数集1中,
VM
位于参数集2中。Powershell无法确定要使用哪个集合,因为
ImageName
在一个集合中,而
VM
在另一个集合中。

欢迎使用堆栈溢出!请坐飞机。你可能想详细说明一下你的问题:你想实现什么?哪一行抛出错误?欢迎使用堆栈溢出!请坐飞机。你可能想详细说明一下你的问题:你想实现什么?哪一行抛出错误?