citrix powershell scripting

PowerShell: Download and Install Citrix Receiver

I have been doing quite a bit of work lately on PowerShell scripting for work and this is a common one we deploy to our clients that use Citrix.

This script does the following:

  1. Creates the folder C:InstallCitrixReceiver
  2. Downloads the latest Citrix Receiver software from the Citrix website
  3. Installs the downloaded Receiver silently
The link for the Citrix Receiver is: http://downloadplugins.citrix.com/Windows/CitrixReceiver.exe
Works with PowerShell v2 and higher.
A lot of my scripts are built to work at this level as it means that I can deploy my scripts to older machines without having to first upgrade PowerShell.

Copy and paste the code into a text file called InstallCitrixReceiver.ps1.

# --------------------------------------------------------------------------
# Citrix Receiver Install Script
# Date: 14-Mar-2016
# Created by: Daniel Burrowes
# --------------------------------------------------------------------------

# -Verbose and -Debug

[CmdletBinding()]
param()

# --------------------------------------------------------------------------
# Change Log
#
# 14-Mar-2016
# -Added /IncludeSSON to argument list
# --------------------------------------------------------------------------

#Create install directory
Write-Verbose "Creating Install Directory"
$InstallDir = "C:InstallCitrixReceiver"
New-Item -Path $InstallDir -ItemType directory -Force


Function Download-Citrx {

$Source = "http://downloadplugins.citrix.com/Windows/CitrixReceiver.exe"
$destination = "C:InstallCitrixReceiverCitrixReceiver.exe"

Write-Verbose "Downloading Software..."
(New-Object System.Net.WebClient).DownloadFile($Source, $Destination)
Write-Verbose "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"

}

Write-Verbose "Downloading Latest Citrix Receiver"
Download-Citrx

Write-Verbose "Running silent install of Citrix Receiver"
Start-Process -FilePath "C:InstallCitrixReceiverCitrixReceiver.exe" -ArgumentList "/silent /IncludeSSON" -Wait -Verbose -PassThru
Executing Powershell scripts may require you to allow scripts to run.:
#Set-Execution Policy -RemoteSigned

4 thoughts on “PowerShell: Download and Install Citrix Receiver

  1. Hi Daniel,

    when I ran below I am getting pop up window and asking for confirmation. how to suppress this confirmation window. I need silent installation. it should not ask any confirmation. Could you please help on this.

    Start-Process -FilePath ".CitrixReceiver.exe" -ArgumentList "/silent /IncludeSSON" -Wait -Verbose -PassThru -Verb runAs

  2. Hi, when I ran below line

    Start-Process -FilePath ".CitrixReceiver.exe" -ArgumentList "/silent /IncludeSSON" -Wait -Verbose -PassThru -Verb runAs

    it is pops up new window and asking for confirmation. how to suppress this aswell. I need silent installation. It should not ask any confirmation. Could you please help me on this?

Leave a Reply

Discover more from Daniel Bs Tech Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading