0
特定のVMのプライベートIPを取得しようとしています。私は名前es-client-node1
、es-client-node2
、es-master-node1
でVMを持って特定のVMのプライベートIPを取得するPowershell
$vms = get-azurermvm -ResourceGroupName abc
$nics = get-azurermnetworkinterface -ResourceGroupName abc| where VirtualMachine -NE $null #skip Nics with no VM
foreach($nic in $nics)
{
$vm = $vms | where-object -Property Id -EQ $nic.VirtualMachine.id
$prv = $nic.IpConfigurations | select-object -ExpandProperty PrivateIpAddress
Write-Output "$($vm.Name) : $prv"
}
、es-data-node1
& es-data-node1
を働いている、このコードを持っています。私はちょうどクライアントノードのIPアドレスを取得したい、またはVMの名前が&のデータノードと同じように一致する
どのようにすればよいのでしょうか?