Apps/Get-CitrixFiles.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
try {

    $Version = Get-Version -Uri 'https://www.citrix.com/downloads/sharefile/clients-and-plug-ins/citrix-files-for-windows.html' -Pattern 'Citrix Files for Windows v((?:\d+\.)+\d+)'

    $URLMsi = Get-Link -Uri 'https://www.citrix.com/downloads/sharefile/clients-and-plug-ins/citrix-files-for-windows.html' -MatchProperty outerHTML -Pattern '\.msi' -ReturnProperty outerHTML
    if ($URLMsi -match 'rel="(//.+\.msi[^"]+)') {
        $URLMsi = "https:" + $Matches[1]
        New-NevergreenApp -Name 'Citrix Files' -Version $Version -Uri $URLMsi -Architecture 'x64' -Type 'Msi'
    }

    $URLExe = Get-Link -Uri 'https://www.citrix.com/downloads/sharefile/clients-and-plug-ins/citrix-files-for-windows.html' -MatchProperty outerHTML -Pattern '\.exe' -ReturnProperty outerHTML
    if ($URLExe -match 'rel="(//.+\.exe[^"]+)') {
        $URLExe = "https:" + $Matches[1]
        New-NevergreenApp -Name 'Citrix Files' -Version $Version -Uri $URLExe -Architecture 'Multi' -Type 'Exe'
    }

}
catch {
    Write-Error "$($MyInvocation.MyCommand): $($_.Exception.Message)"
}