Pcornel
Automation · VMware Automation

PowerCLI

Cheat sheet · https://pcornel.dk/topic.php?topic=5734

Back to the Topic

Answer

PowerCLI is VMware's PowerShell module for vSphere and related products. Connect-VIServer then cmdlets like Get-VM, New-VM and Set-VM automate almost any vCenter task.

Remember

  • PowerCLI is VMware's PowerShell module.
  • Connect-VIServer starts a session.
  • Set InvalidCertificateAction for self-signed certs.

First checks

  • Connect-VIServer <vc> — connect
  • Get-VM | select Name,PowerState,NumCpu,MemoryGB — inventory
  • Get-PowerCLIConfiguration — settings (InvalidCertificateAction)

Verify in this order

PowerCLI → vCenter → objects

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5734

Confirmation

Confirm action

Continue?