Script Extracts and Examples (PowerCLI): Difference between revisions

From vwiki
Jump to navigation Jump to search
m (Minor correction)
m (Typo fix)
 
(98 intermediate revisions by the same user not shown)
Line 1: Line 1:
Before being able to use any the following script you need to install...
#REDIRECT [[:Category:PowerCLI]]
* [http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx Windows PowerShell]
* [http://www.vmware.com/go/powershell VI Toolkit]
 
== 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"

Latest revision as of 15:36, 4 October 2016

Redirect to: