I have a VM inventory/status script and am collecting the vNIC property name but it keeps returning a response that I need but is not "pretty" I want to remove the word Virtual from the results.
Get-View -ViewType VirtualMachine -Filter @{'Runtime.PowerState'='poweredOn'} |
Select Name,
@{N='Network Adapter';E={$_.Config.Hardware.Device | Where {$_ -is [VMware.Vim.VirtualEthernetCard]} | ForEach {$_.GetType().Name}}} | Out-GridView
I have tried every variation of remove, replace, etc... and still get "VirtualVmxnet3" and just want to see Vmxnet3. I know that is picky but, go big or go home.
Does this help?
Select Name,
@{N='Network Adapter';E={
$_.Config.Hardware.Device | Where {$_ -is [VMware.Vim.VirtualEthernetCard]} |
ForEach {$_.GetType().Name.Replace('Virtual','')}}} | Out-GridView
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Does this help?
Select Name,
@{N='Network Adapter';E={
$_.Config.Hardware.Device | Where {$_ -is [VMware.Vim.VirtualEthernetCard]} |
ForEach {$_.GetType().Name.Replace('Virtual','')}}} | Out-GridView
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you LucD!! I was so close. Getting back into the swing of managing the environment full time.