One cmdlet per endpoint and method, generated from the Proxmox VE API: its parameters, their types and allowed values come from the API itself.
Up and running in 4 steps
- Install the module
- Load it
- Connect to a node
- Run your first cmdlets
Automate Proxmox VE from PowerShell
By sysadmins, for sysadmins.
Built by Corsinvest, official Proxmox partner.
# install from the PowerShell GalleryInstall-Module Corsinvest.ProxmoxVE.ApiImport-Module Corsinvest.ProxmoxVE.Api
# connect to any nodeConnect-PveCluster -HostsAndPorts pve01 ` -ApiToken 'automation@pve!ps=…'
# every VM and container of the clusterGet-PveGuest | Format-Table vmid, name, node, status| vmid | name | node | type | status |
|---|---|---|---|---|
| 105 | test | pve01 | lxc | stopped |
| 1000 | firewall01 | pve01 | qemu | running |
| 1006 | dc01 | pve01 | qemu | running |
| 100 | backup01 | pve02 | lxc | running |
| 102 | firewall02 | pve02 | qemu | running |
| 203 | test-debian | pve02 | qemu | stopped |
| 1012 | mailstore | pve02 | qemu | running |

The Proxmox VE web interface is made for one action at a time. Snapshot forty VMs before an update, list every VM with its disks for an audit, clone a template ten times, shut down a lab every evening: by hand it is slow and error-prone, and the shell of a node is not where you want to run your company’s scripts.
VMware administrators have PowerCLI for this. cv4pve-api-powershell is the same idea for Proxmox VE:
the whole API as PowerShell cmdlets, so the scripts, scheduled tasks and habits you already have keep
working: objects in the pipeline, Where-Object, Export-Csv, Get-Help.
On your machine, API only
Section titled “On your machine, API only”The module runs where PowerShell 7 runs (Windows, Linux, macOS, a management VM, a CI runner) and talks only to the Proxmox VE REST API on port 8006. Nothing is installed on the nodes and no SSH is needed. What a script can do is what its API token or user is allowed to do: give it a token with just the privileges it needs, see Permissions.
Where it fits
Section titled “Where it fits”The cv4pve suite follows the Unix philosophy: each tool does one thing and does it well. cv4pve-api-powershell is the one for your own PowerShell scripts: any API call, with objects. Prefer a command line that works in any shell? cv4pve-cli calls the same API with text output. For an inventory or a health check of the cluster, ready to run, see cv4pve-report and cv4pve-diag.
What it does for you
Section titled “What it does for you”Get-PveGuest finds VMs and containers by id, name, range, node, pool or tag, with exclusions; the same selection starts, stops or snapshots them all in one call.
Connect with an API token or a user and password, list several nodes and the first one that answers is used.
Every call returns the Proxmox VE data as PowerShell objects, with the HTTP outcome beside it: filter, sort, export to CSV.
Start a backup, a clone or a migration and wait for its task to finish, with a progress bar if you like.
Invoke-PveRestApi calls any path of the API directly, with the same connection.
Write your first script
Install the module from the PowerShell Gallery, connect to any node, list your VMs.
official Proxmox partner