Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (31 sloc) 1.34 KB
# Powershell on Linux :
# Powercli on Linux:
echo "Checking the code name of the Ubuntu 16.04"
mystatus=`lsb_release -c | awk -F: '{print $2}' | xargs`
if [ "$mystatus" = "xenial" ]; then
echo "Starting the Installation of Powershell:-->"
echo "Import the public repository GPG keys:-->"
curl | sudo apt-key add -
echo "Register the Microsoft Ubuntu repository:-->"
curl | sudo tee /etc/apt/sources.list.d/microsoft.list
echo "Update the list of products:-->"
sudo apt-get update
echo "Installing PowerShell::-->"
sudo apt-get install -y powershell
sleep 5
echo "Printing the Powershell Version:-->"
pwsh --version
sleep 5
echo "Setting the Repo to Trusted:-->"
pwsh -c Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
echo "Getting the Repo Information:-->"
pwsh -c Get-PSRepository
echo "Installing Powercli::--> This might take time"
pwsh -c Install-Module VMware.PowerCLI -Scope CurrentUser
echo "Check the installation is completed:-->"
pwsh -c Get-Module VMware.* -ListAvailable
echo "It is not the correct version of Ubuntu 16.04"