Jump to content
Toggle menu
  • 51 articles
  • 24 files
  • 4 users
  • 750 edits
Tech-Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Using PowerCLI in Powershell

From Tech-Wiki


Use Broadcom VMware PowerCLI to connect to vCenter and export common virtual-machine inventory information.

ⓘ
Validation status
Reviewed against the current VMware PowerCLI command reference on 27 September 2026.

Install PowerCLI

>_Install PowerCLI
Install-Module VMware.PowerCLI -Scope CurrentUser

Connect securely

$Credential = Get-Credential
Connect-VIServer -Server vcenter.example.com -Credential $Credential
!
Do not make certificate validation Ignore the default
The legacy article configured InvalidCertificateAction Ignore. Prefer a trusted vCenter certificate or an explicitly approved certificate-handling policy rather than silently accepting invalid certificates.

Inventory examples

Get-VM |
    Select-Object Name,PowerState,MemoryGB,NumCpu,UsedSpaceGB
Get-VM |
    Select-Object Name,PowerState,MemoryGB,NumCpu,UsedSpaceGB |
    Export-Csv .\vm-inventory.csv -NoTypeInformation

Disconnect when finished:

>_Disconnect
Disconnect-VIServer -Server vcenter.example.com -Confirm:$false

Official references