Install PowerShell Core with PowerCLI on ubuntu 18.04

Steps to install PowerShell Core with PowerCLI on ubuntu 18.04

  1. Switch to root and install PowerShell Core
#Switch to root
su -

# Download the Microsoft repository GPG keys
wget -q

# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb

# Update the list of products
sudo apt-get update

# Install PowerShell
sudo apt-get install -y powershell

# Start PowerShell
  1. You can upgrade the PowerShell Core if there is any new version released with
sudo apt-get upgrade powershell
  1. Install VMware PowerCLI
Install-Module -Name VMware.PowerCLI

#Ignore the Selfsign Certificate warning when connecting to vSphere Host / vCenter
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore

#Import VMware Module
Import-Module VMware.VimAutomation.Core

#Connect to ESXi host or vCenter
$ESXi = ""
$User = "root"
$Password = "P@ssw0rd"

Connect-VIServer -Server $ESXi -User $User -Password $Password -WarningAction SilentlyContinue
  1. I try to run Sample Preventive Maintenance Reports which i prepared on my Windows 10 machines and it is working fine



Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top