Try like this.
If you have more than 1 vNic on a VM, the Instance property will indicate for which vNic on the VM the Value is.
$vmName = 'MyVM'
$vm = Get-VM -Name $vmName
$stat = 'net.droppedTx.summation'
Get-Stat -Entity $vm -Stat $stat -Realtime
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this.
If you have more than 1 vNic on a VM, the Instance property will indicate for which vNic on the VM the Value is.
$vmName = 'MyVM'
$vm = Get-VM -Name $vmName
$stat = 'net.droppedTx.summation'
Get-Stat -Entity $vm -Stat $stat -Realtime
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Got it!
As I was not getting this stat after getting output of get-vm <vm-name> |get-stattype , I thought it doesn't exist from cli level. Should we always check from get-stattype about the stat available for the object ?
I was getting below stat listed for a VM
get-vm <name> |Get-StatType
cpu.usage.average
cpu.usagemhz.average
cpu.ready.summation
mem.usage.average
mem.swapinRate.average
mem.swapoutRate.average
mem.vmmemctl.average
mem.consumed.average
mem.overhead.average
disk.usage.average
disk.maxTotalLatency.latest
net.usage.average
sys.uptime.latest
cpu.cpuentitlement.latest
mem.mementitlement.latest
disk.used.latest
disk.provisioned.latest
disk.unshared.latest
Yes, and also take into account the Realtime and Historical intervals.
Since I know this is a network related metric, I filter on metrics starting with 'net'
Get-StatType -Entity (get-VM AnyVM) -Realtime | where{$_ -match 'net.'}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference