WLS Ubuntu 20.04 – Powercli On Linux and use it for Horizon

Well I want to use my WSL Ubuntu 20.04 to use powercli command to manage old Horizon Version (Flash ko)

  • Start to install all updates on my Ubuntu 20.04

sudo apt-get update

sudo apt-get upgrade

  • Configure source for downlad ed install powercli 

sudo apt-get install curl

 curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add

sudo curl -o /etc/apt/sources.list.d/microsoft.list https://packages.microsoft.com/config/ubuntu/20.04/prod.list

sudo apt-get update

  • Install powershell 

sudo apt-get install powershell

sudo pwsh

Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore

  • Install PowerCli Module

Install-Module -Name VMware.PowerCLI

  • Install the horizon module

Import-Module -Name VMware.VimAutomation.HorizonView

  • Download additional module

For download

Run Example Horizon PowerCLI Scripts (vmware.com)

  • Import Horizon Module

Create Horizon Desktop Pool using PowerCLI – Roderik de Block

PowerCLI-Example-Scripts/New-HVPool.md at master · vmware/PowerCLI-Example-Scripts · GitHub

WLS Ubuntu 20.04 – Powercli On Linux and use it for Horizon

Copy file to VMware Datastore using Powercli

https://kb.vmware.com/s/article/2001041

#Mi collego all’Host ESXi dove devo copiare la ISO
Connect-ViServer <hostname>
#Visualizzo l’elenco dei datastore
Get-Datastore
#Seleziono il datastore che mi interessa
$datastore = Get-Datastore “<nome del datastore>”
#Eseguo il mount del PSDrive sotto ds:
New-PSDrive -Location $datastore -Name ds -PSProvider VimDatastore -Root “”
#Lancio la copia
Copy-DatastoreItem -Item c:……Windows2016.iso -Destinatiom ds:ISO

Copy file to VMware Datastore using Powercli