PowerCLI Command Builder

Generate PowerCLI commands for VMware vSphere — no syntax lookup required.

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.

How to use

  1. Select a category from the tab bar — Virtual Machines, Snapshots, ESXi Hosts, Datastores, or Connection.
  2. Click a task row to expand it.
  3. Fill in the required fields. Optional fields are marked.
  4. Click Build command to generate the PowerCLI command.
  5. Click the copy icon to copy the command to your clipboard.
  6. 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.

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

Useful links