Inspired by the AutoCPS update script by http://www.thomaskoetzing.de I created this powershell script to download all hotfixes for Citrix Products by using the hotfix RSS feeds.
This scrip does not install the updates, it just downloads and extracts the files into your hotfix folder.
The script uses Powershell ISE, to install it, run the following powershell commands first:
- Import-Module ServerManager
- Add-WindowsFeature PowerShell-ISE
When you run it, you will get a menu to select product to get hotfixes for. You may add the RSS feed for other products in the script to extend the product list.
Select the updates you want to download in the gridview, and hit OK to start the download process.
By default, c:\CTXUPDATE folder is used for downloads, this may be modified in the script.
Here is the script: (You may also download the script here: DOWNLOAD)
Write-Host
“Choose Citrix product to update.”
Write-Host
“1. XenApp 6.5″
Write-Host
“2. XenApp 6.0″
Write-Host
“3. XenApp 5.0″
Write-Host
“4. PVS 6.1″
Write-Host
“5. PVS 6.0″
Write-Host
“6. PVS 5.6″
Write-Host
“7. XenDesktop 5.6″
Write-Host
“8. XenDesktop 5.5″
Write-Host
“9. XenDesktop 5.0″
Write-Host
“10. Xenserver 6.1″
Write-Host
“11. Xenserver 6.0″
Write-Host
“12. Xenserver 5.6″
Write-Host
” “
$a
=
Read-Host
“Select 1-12: “
Write-Host
” “
switch ($a)
{
1 {
$url
=
“http://support.citrix.com/product/xa/v6.5_2008r2/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\XA65″
}
2 {
$url
=
“http://support.citrix.com/product/xa/v6.0_2008r2/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\XA60″
}
3 {
$url
=
“http://support.citrix.com/product/xa/v5.0_2008/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\XA50″
}
4 {
$url
=
“http://support.citrix.com/product/provsvr/pvsv6.1/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\PVS61″
}
5 {
$url
=
“http://support.citrix.com/product/provsvr/pvsv6.0/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\PVS60″
}
6 {
$url
=
“http://support.citrix.com/product/provsvr/pvsv5.6/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\PVS56″
}
7 {
$url
=
“http://support.citrix.com/product/xd/v5.6/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\XD56″
}
8 {
$url
=
“http://support.citrix.com/product/xd/v5.5/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\XD55″
}
9 {
$url
=
“http://support.citrix.com/product/xd/v5/hotfix/general/?rss=on”
$path=
“c:\CTXUPDATE\XD50″
}
9 {
$url
=
“http://support.citrix.com/product/xens/v6.0/hotfix/general/public/?rss=on”
$path=
“c:\CTXUPDATE\XS60″
}
10 {
$url
=
“http://support.citrix.com/product/xens/v6.1/hotfix/general/public/?rss=on”
$path=
“c:\CTXUPDATE\XS61″
}
11 {
$url
=
“http://support.citrix.com/product/xens/v6.0/hotfix/general/public/?rss=on”
$path=
“c:\CTXUPDATE\XS60″
}
12 {
$url
=
“http://support.citrix.com/product/xens/v5.6/hotfix/general/public/?rss=on”
$path=
“c:\CTXUPDATE\XS56″
}
default {
$url
=
“”
$path=
“”
}
}
Write-Host
“Citrix hotfix update script”
$wc
=
New-Object
net.webclient
[xml]$xml =
$wc.DownloadString($url)
$xml.rdf.item|Select
Title, Description, Link |
out-gridview
-Title
“Select hotfixes to download”
-PassThru
|
% {
$result
=
Invoke-WebRequest
$psitem.link
$link= $result.links |
Where
title
-eq
“Download”|
Select
-First
1
-ExpandProperty
href
$filename=$link.substring(($link.lastindexOf(“/”)+1),($link.Length-$link.lastindexOf(“/”)-1))
$foldername=$filename.substring(0,($filename.lastindexOf(“.”)))
if (Test-Path ($path
+
“\”
+
$filename)){
Write-Host
“Skipping $filename“
}
else{
Write-Host
“Downloading $filename“
$wc.DownloadFile(“https://support.citrix.com”
+ $link, $path
+
“\”
+
$filename)
Write-Host
“Unzipping $filename“
md ($Path
+
“\$foldername“)
$shell_app=new-object
-com
shell.application
$zip_file
=
$shell_app.namespace($path
+
“\$filename“)
$destination
=
$shell_app.namespace($Path
+
“\$foldername“)
$destination.Copyhere($zip_file.items())
}
}