Monday, April 25, 2016

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:\Install\CitrixReceiver
  2. Downloads the latest Citrix Receiver software from the Citrix website
  3. Installs the downloaded Receiver silently
The link for the Citrix Receiver is:

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


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

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

Function Download-Citrx {

 $Source = ""
 $destination = "C:\Install\CitrixReceiver\CitrixReceiver.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"

Write-Verbose "Running silent install of Citrix Receiver"
Start-Process -FilePath "C:\Install\CitrixReceiver\CitrixReceiver.exe" -ArgumentList "/silent /IncludeSSON" -Wait -Verbose -PassThru

Executing Powershell scripts may require you to allow scripts to run.:
#Set-Execution Policy -RemoteSigned


  1. Does this install in administrator mode so that the install is on the machine rather than in the users app data??

    1. Assuming you run the script as an administrator. All installs i have done with this installed it to the machine, not the user.

  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?

  3. 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