From e0878d97b052122f0b8340d931bd075ddb17a693 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Mon, 9 Oct 2023 23:20:04 +1100 Subject: [PATCH] Add CitrixShareFile --- Evergreen/Apps/Get-CitrixShareFile.ps1 | 43 ++++++++++++++++++++++++ Evergreen/Manifests/CitrixShareFile.json | 21 ++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 Evergreen/Apps/Get-CitrixShareFile.ps1 create mode 100644 Evergreen/Manifests/CitrixShareFile.json diff --git a/Evergreen/Apps/Get-CitrixShareFile.ps1 b/Evergreen/Apps/Get-CitrixShareFile.ps1 new file mode 100644 index 00000000..7c24249e --- /dev/null +++ b/Evergreen/Apps/Get-CitrixShareFile.ps1 @@ -0,0 +1,43 @@ +function Get-CitrixShareFile { + <# + .SYNOPSIS + Returns the current Citrix ShareFile for Windows releases. + + .NOTES + Author: Tschuegy + Twitter: + #> + [OutputType([System.Management.Automation.PSObject])] + [CmdletBinding(SupportsShouldProcess = $false)] + param ( + [Parameter(Mandatory = $false, Position = 0)] + [ValidateNotNull()] + [System.Management.Automation.PSObject] + $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) + ) + + # Read the Citrix ShareFile for Windows for updater feed + $params = @{ + Uri = $res.Get.Update.Uri + } + $UpdateFeed = Invoke-RestMethodWrapper @params + + # Walk through each node to output details + if ($null -ne $UpdateFeed) { + + # Select the latest version + $Latest = $UpdateFeed | ` + Sort-Object -Property @{ Expression = { [System.Version]$_.Version }; Descending = $true } -ErrorAction "SilentlyContinue" | ` + Select-Object -First 1 + + # Create the output object + $PSObject = [PSCustomObject] @{ + Version = $Latest.enclosure.version + Date = ConvertTo-DateTime -DateTime $($Latest.pubDate) -Pattern $($res.Get.Update.DatePattern) + Size = $(if ($Latest.enclosure.length) { $Latest.enclosure.length } else { "Unknown" }) + Hash = $Latest.enclosure.dsaSignature + URI = $Latest.enclosure.url + } + Write-Output -InputObject $PSObject + } +} diff --git a/Evergreen/Manifests/CitrixShareFile.json b/Evergreen/Manifests/CitrixShareFile.json new file mode 100644 index 00000000..a5ec9c4e --- /dev/null +++ b/Evergreen/Manifests/CitrixShareFile.json @@ -0,0 +1,21 @@ +{ + "Name": "Citrix ShareFile for Windows", + "Source": "https://www.citrix.com/downloads/sharefile/clients-and-plug-ins/citrix-files-for-windows.html", + "Get": { + "Update": { + "Uri": "http://www.sf-cdn.net/downloads/cfwin/updates.xml", + "DatePattern": "ddd, dd MMM yyyy HH:mm:ss zzzz" + } + }, + "Install": { + "Setup": "CitrixFilesForWindows*.exe|ShareFileForWindows*.exe", + "Physical": { + "Arguments": "/install /quiet /norestart", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "/install /quiet /norestart", + "PostInstall": [] + } + } +}