Setting Up for Linux Desktops

Table Of Contents
n
Whether to disable vSphere VM console
Script Content
<#
Create Clones from a Master VM
The Tool supports creation of Full clone and linked clone from Master VM.
The parent VM is required for the linked-clone to work and the parent VMs file cannot be renamed
or moved.
#>
#------------------------- Functions -------------------------
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
}
function IsVMExists ()
{
Param($VMExists)
Write-Host "Checking if the VM $VMExists already Exists"
[bool]$Exists = $false
#Get all VMS and check if the VMs is already present in VC
$listvm = Get-vm
foreach ($lvm in $listvm)
{
if($VMExists -eq $lvm.Name )
{
$Exists = $true
}
}
return $Exists
}
function Disable_VM_Console()
{
Param($VMToDisableConsole)
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
Setting Up Horizon 7 for Linux Desktops
70 VMware, Inc.