PowerCLI

PowerCLI install on Ubuntu

# apt-get update -y
# snap install powershell --classic
# pwsh
PS /home/ludo> Install-Module Microsoft.PowerShell.GraphicalTools
PS /home/ludo> Install-Module Microsoft.PowerShell.ConsoleGuiTools
PS /home/ludo> Install-Module -Name VMware.PowerCLI
PS /home/ludo> Set-PowerCLIConfiguration -InvalidCertificateAction Ignore

Connect to a Server

Connect-VIServer vc67.ludo.local

List events at a specific date

Get-VIEvent -Start 23/08/2020 -Finish 25/08/2020 | Out-GridView

Export events to a file

Get-VIEvent -Start 23/08/2020 -Finish 25/08/2020 | Export-Csv C:\Users\Ludo\Desktop\Events.csv

List events in a table for a specific Entity

Get-VIEvent -Entity "New Virtual Machine" -Start 23/08/2020 -Finish 25/08/2020 | Out-GridView

List VMs

Get-VM | Select-Object -Property Name,Id,VMHost | Out-GridView