Hi Everyone,
I am a newbie with Power CLI, and I have been battling to get a report that provide me with the following for VMGuests :Alotted CPU, Alotted Memory, Used Disk space all in the same report in a CSV format.
This is what I have thus far
Get-VM | `
Select-Object Name,@{N="UsedSpaceMB";E={[math]::Round($_.UsedSpaceGB*1KB,0)}},NumCpu,MemoryMB,
@{N="SnapshotSizeMB";E={[math]::Round(($_ | Get-Snapshot | Measure-Object -Property SizeMB -Sum).Sum,0)}} | `
Format-Table -AutoSize | Out-File C:\_localdata\vmware\powershell\VMsReport.txt
I cant get it to go to CSV and retai nthe information
any help would be appreciated
Simply change this line:
Format-Table -AutoSize | Out-File C:\_localdata\vmware\powershell\VMsReport.txt
To:
Export-Csv C:\_localdata\vmware\powershell\VMsReport.csv -notypeinformation
Thanks Chris,
That did the trick
Thank You