Setting Up for Linux Desktops

Table Of Contents
write-host "Run cmd on $VM_Name ($IP)"
if($returnOutput)
{
$command = "echo yes | .\plink.exe -ssh -l $user -pw $password $IP " + '"' + $cmd +'"'
$output = Invoke-Expression $command
return $output
}
else
{
echo yes | .\plink.exe -ssh -l $user -pw $password $IP "$cmd"
}
}
function UploadFileViaSSH
{
Param($VM_Name, $User, $Password, $LocalPath, $DestPath)
$VM= Get-VM $VM_Name
$IP = $VM.guest.IPAddress[0]
$command = "echo yes | .\pscp.exe -l $User -pw $Password $LocalPath $IP" + ":" + "$DestPath"
write-host "Upload file: $command"
Invoke-Expression $command
}
#------------------------- Handle Input -------------------------
"-----------------------------------------------------"
Check_SSH_Client -IsPlink $true -IsPSCP $true
"-----------------------------------------------------"
$acceptEULA = GetInput -prompt 'Accept Linux Horizon Agent EULA in tar bundle ("yes" or "no")' -
IsPassword $false
if ($acceptEULA -ne "yes")
{
write-host -ForeGroundColor Red "You need accept the EULA with 'yes'(case sensitive)"
exit
}
$vcAddress = GetInput -prompt "Your vCenter address" -IsPassword $false
$vcAdmin = GetInput -prompt "Your vCenter admin user name" -IsPassword $false
$vcPassword = GetInput -prompt "Your vCenter admin user password" -IsPassword $true
"-----------------------------------------------------"
$guestUser = GetInput -prompt 'Your VM guest OS user name' -IsPassword $false
$guestPassword = GetInput -prompt 'Your VM guest OS user password' -IsPassword $true
"-----------------------------------------------------"
$agentInstaller = GetInput -prompt 'Type the Horizon Agent tar ball path. Please take care the
installer arch' -IsPassword $false
"-----------------------------------------------------"
$brokerAddress = GetInput -prompt 'Type the View Connection Server address' -IsPassword $false
$brokerAdminName = GetInput -prompt 'Type the View Connection Server Admin user name' -
IsPassword $false
"`nPlease type the View Connection Server Admin user password."
[Console]::ForegroundColor = "Yellow"
"Plase note that special character should be escaped. For example, $ should be \$"
[Console]::ResetColor()
$brokerAdminPassword = GetInput -prompt 'Your broker admin password' -AsSecureString -
IsPassword $true
Setting Up Horizon 7 for Linux Desktops
72 VMware, Inc.