Setting Up for Linux Desktops

Table Of Contents
function GetInput
{
Param($prompt, $IsPassword = $false)
$prompt = $prompt + ": "
Write-Host $prompt -NoNewLine
[Console]::ForegroundColor = "Blue"
if ($IsPassword)
{
$input = Read-Host -AsSecureString
$input =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($input))
}
else
{
$input = Read-Host
}
[Console]::ResetColor()
return $input
}
#-----------------------------------------------------Handle
input-------------------------------------------------------------------
"-----------------------------------------------------"
$acceptEULA = GetInput -prompt 'Accept Linux View 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
"-----------------------------------------------------"
$hostAdmin = GetInput -prompt 'Your ESXi host admin user name, such as root' -IsPassword $false
$hostPassword = GetInput -prompt "Your ESXi 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 View Agent tar ball path' -IsPassword $false
"-----------------------------------------------------"
$UpgradeToManagedVM = GetInput -prompt 'Upgrade to managed VM ("yes" or "no")' -IsPassword $false
if (($UpgradeToManagedVM -ne "yes") -AND $UpgradeToManagedVM -ne "no")
{
write-host -ForeGroundColor Red "You need select 'yes' or 'no'(case sensitive)"
exit
}
$installSmartcard = GetInput -prompt 'Install the Smartcard redirection feature ("yes" or "no")'
-IsPassword $false
if (($installSmartcard -ne "yes") -AND $installSmartcard -ne "no")
{
write-host -ForeGroundColor Red "You need select 'yes' or 'no'(case sensitive)"
exit
Setting Up Horizon 7 for Linux Desktops
88 VMware, Inc.