Does anyone have a script handy that gets the VM name, MAC and IP from a text file containg specific VM names using the Get-Content function?
Thanks,
Try something like this
Get-vm -Name (Get-Content -Path C:\vmnames.txt) |
Select Name,
@{N="IP addr";E={[string]::Join(',',$_.Guest.IPAddress)}},
@{N="MAC addr";E={[string]::Join(',',($_.Guest.Nics | %{$_.MacAddress}))}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
Get-vm -Name (Get-Content -Path C:\vmnames.txt) |
Select Name,
@{N="IP addr";E={[string]::Join(',',$_.Guest.IPAddress)}},
@{N="MAC addr";E={[string]::Join(',',($_.Guest.Nics | %{$_.MacAddress}))}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Perfect...Thanks Luc!