Understand Basic Commands – vSphere Power CLI
List Datacenter Inventory
> Get-Datacenter
Name
—-
DATACENTER NAME
List Cluster Inventory
> Get-Cluster
Name HAEnabled HAFailover DrsEnabled DrsAutomationLevel
Level
—- ——— ———- ———- ——————
Cluster Name True 0 False FullyAutomated
List Complete HOST Inventory
> Get-VMHost
Name Connection PowerState NumCpu CpuUsage CpuTotal Memory Memory Version
State MhzMhz UsageGB TotalGB
—- ———– ——- —– ——- ——– ——– ——– ——
esxi-01 Connected PoweredOn 8 387 19200 24.840 159.990 6.0.0
esxi-02 Connected PoweredOn 8 2730 19200 48.579 159.990 6.0.0
List Complete VM Inventory
> Get-VM –
Name PowerState Num CPUs MemoryGB
—- ———- ——– ——–
TESTVM PoweredOn 4 4.000
List Datastore Inventory
>Get-Datastore
Name FreeSpaceGB CapacityGB
——- —————- ————-
esxi-01(Local) 130.802 131.750
esxi-02(Local) 130.802 131.750
List vswitch Inventory
> Get-VirtualSwitch
Name NumPorts Mtu Notes
——- ———— —– ——-
vSwitch0 3072 1500
vSwitch1 3072 1500
List Portgroup Inventory
> Get-VirtualPortGroup
Name Key VLanId
———– ——– ——–
VmNeetwork1 Key-vim.host.PortGroup-VmNeetwork1 122
VmNeetwork2 key-vim.host.PortGroup-VmNeetwork2 123
Generate complete snapshot inventory with few details
> get-vm | Get-Snapshot
Name Description PowerState
——– ———– ————-
VM Tools PoweredOn
VM Tools PoweredOn
Restore Point Avamar Snapshot generated for back PoweredOff