Script Extracts and Examples (PowerCLI)
Jump to navigation
Jump to search
Before being able to use any the following script you need to install...
VM Datastores
List of Virtual Machines, and their datastores (with usage)
$datastoreExp = @{N="Datastore"; E={ ($_ | get-datastore | select-object -first 1).Name }} $diskSizeExp = @{N="Total Disk"; E={ ($_ | get-harddisk | measure-object -property CapacityKB -sum).Sum }} get-vm | select Name, $datastoreExp, $diskSizeExp | sort -property Datastore,"Total Disk"