PowerCLI is VMware’s PowerShell module for managing vSphere infrastructure. Whether you’re querying VMs, creating snapshots, or connecting to vCenter, getting the syntax right every time is tedious. This tool builds ready-to-run PowerCLI commands from your inputs — no documentation lookup required.
Select a task, fill in the parameters, and copy the command directly into your PowerShell session.
| Task | Cmdlet |
|---|---|
| Virtual Machines | |
| List all VMs | Get-VM |
| Find VM by name | Get-VM -Name |
| List VMs on a host | Get-VM -Location |
| Start a VM | Start-VM |
| Stop a VM (graceful) | Stop-VM |
| Get VM CPU & memory | Get-VM | Select-Object |
| Snapshots | |
| List snapshots for a VM | Get-Snapshot |
| Create a snapshot | New-Snapshot |
| Remove a snapshot | Remove-Snapshot |
| List all snapshots (all VMs) | Get-VM | Get-Snapshot |
| ESXi Hosts | |
| List all ESXi hosts | Get-VMHost |
| Check host connection state | Get-VMHost | Select-Object |
| Get ESXi version | Get-VMHost | Select-Object Version |
| Datastores | |
| List all datastores | Get-Datastore |
| Check datastore free space | Get-Datastore | Select-Object |
| Connection | |
| Connect to vCenter / ESXi | Connect-VIServer |
| Disconnect from server | Disconnect-VIServer |
How to use
- Select a category from the tab bar — Virtual Machines, Snapshots, ESXi Hosts, Datastores, or Connection.
- Click a task row to expand it.
- Fill in the required fields. Optional fields are marked.
- Click Build command to generate the PowerCLI command.
- Click the copy icon to copy the command to your clipboard.
- Paste directly into your PowerShell session.
FAQ
Frequently asked questions
Yes. Most commands require an active connection to a vCenter Server or ESXi host. Use the Connect-VIServer command from the Connection category first. Once connected, all subsequent commands in the same PowerShell session will use that connection automatically.
These commands are compatible with VMware PowerCLI 12.0 and later. Most cmdlets shown here have been stable since PowerCLI 6.5. If you are running an older version, some parameter names may differ slightly.
PowerCLI is installed from the PowerShell Gallery. Run this command in an elevated PowerShell session:
Install-Module -Name VMware.PowerCLI -Scope CurrentUser
You can find detailed installation steps in the article linked below.
Yes. Connect-VIServer works with both vCenter Server and standalone ESXi hosts. Enter the ESXi host IP or hostname directly in the Server field. Note that some cmdlets like Get-Cluster are only available when connected to vCenter.
Stop-VM sends a shutdown signal through VMware Tools. If VMware Tools is not installed, not running, or the guest OS is unresponsive, the command completes without actually shutting down the VM. Use Stop-VM -Kill to force a hard power-off when needed.
Read-only commands like Get-VM, Get-Snapshot, and Get-Datastore are safe to run at any time. Commands that modify state — Start-VM, Stop-VM, New-Snapshot, Remove-Snapshot — should be tested in a non-production environment first. Always verify the target VM or host name before running destructive commands.
Practical examples
Connect to vCenter and list all powered-off VMs:
Connect-VIServer -Server "vcenter.corp.local"
Get-VM | Where-Object { $_.PowerState -eq "PoweredOff" }
Create a snapshot before patching, then verify it exists:
New-Snapshot -VM "web-server-01" -Name "pre-patch-2026-04-10" -Description "Before April patches" -Confirm:$false
Get-Snapshot -VM "web-server-01"
Find all VMs with snapshots older than 7 days:
Get-VM | Get-Snapshot | Where-Object { $_.Created -lt (Get-Date).AddDays(-7) } | Select-Object VM, Name, Created, SizeMB
Check free space on all datastores:
Get-Datastore | Select-Object Name, @{N="CapacityGB";E={[math]::Round($_.CapacityGB,1)}}, @{N="FreeSpaceGB";E={[math]::Round($_.FreeSpaceGB,1)}} | Sort-Object FreeSpaceGB