also
below is what gives avarage value but i need percentage is there any direct property for percentage also similar to
cpu.usagemhz.average
Get-VM | Where {$_.PowerState -eq "PoweredOn"} | Select Name,
@{N="CPU Usage (Average), Mhz" ; E={[Math]::Round((($_ | Get-Stat -Stat cpu.usagemhz.average -Start (Get-Date).AddDays(-30) -IntervalMins 5 | Measure-Object Value -Average).Average),2)}}
Export-Csv -Path c:AverageUsage.csv