Getting started with PowerCLI

 

#Set the participation to false and ignore invalid certificates for all users
Set-PowerCLIConfiguration -Scope AllUsers -ParticipateInCeip $false -InvalidCertificateAction Ignore
#Connect to our vCenter Server using the logged in credentials
Connect-VIServer PAC-vCSA01

 

Ignore Invalid Certs:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

Useful commands:

Get-Task – Shows currently running tasks
Get-VM – Lists all VMs

To list all snapshots and the size they take:

Get-VM | Format-Table Name, @{Label="NumSnapshots";Expression={(Get-Snapshot -VM $_ | Measure-Object).Count}}, @{Label="TotalSnapShotSizeMB";Expression={(Get-Snapshot -VM $_ | Measure-Object -Sum SizeMB).Sum}}

CategoriesIT