From 26218a1a7cc68659805f184738f7c623ba8e6239 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Fri, 29 Nov 2024 09:46:05 +1100 Subject: [PATCH 1/2] Update Get-QGIS.ps1 #775 --- Evergreen/Apps/Get-QGIS.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Evergreen/Apps/Get-QGIS.ps1 b/Evergreen/Apps/Get-QGIS.ps1 index 9f93724d..4d5223fb 100644 --- a/Evergreen/Apps/Get-QGIS.ps1 +++ b/Evergreen/Apps/Get-QGIS.ps1 @@ -19,12 +19,12 @@ function Get-QGIS { # Return an object for each channel foreach ($Channel in $res.Get.Update.Channels) { - $Version = "$($UpdateFeed.$Channel.version)-$($UpdateFeed.$Channel.binary)" + $Version = "$($UpdateFeed.$Channel.major).$($UpdateFeed.$Channel.minor).$($UpdateFeed.$Channel.patch)-$($UpdateFeed.$Channel.binary)" [PSCustomObject]@{ Version = $Version Channel = $Channel - Date = $UpdateFeed.$Channel.date + Date = $(if ($UpdateFeed.$Channel.date -eq "") { $null } else { ConvertTo-DateTime -DateTime $UpdateFeed.$Channel.date -Pattern "yyyy-MM-dd" }) URI = $res.Get.Download.Uri -replace $res.Get.Download.ReplaceText, $Version } | Write-Output } -} \ No newline at end of file +} From 28e75f67551ede3f6ee7973839de441badfeed7b Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Wed, 4 Dec 2024 00:04:47 +1100 Subject: [PATCH 2/2] Refactor Get-CitrixWorkspaceApp.ps1 to improve update feed handling and add throttling warning --- Evergreen/Apps/Get-CitrixWorkspaceApp.ps1 | 58 +++++++++++++---------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/Evergreen/Apps/Get-CitrixWorkspaceApp.ps1 b/Evergreen/Apps/Get-CitrixWorkspaceApp.ps1 index 806b36a3..ce6e5b98 100644 --- a/Evergreen/Apps/Get-CitrixWorkspaceApp.ps1 +++ b/Evergreen/Apps/Get-CitrixWorkspaceApp.ps1 @@ -16,39 +16,45 @@ $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) ) - # Read the Citrix Workspace app for updater feed for each OS in the list - $params = @{ - Uri = $res.Get.Update.Uri - UserAgent = $res.Get.Update.UserAgent + begin { + Write-Warning -Message "$($MyInvocation.MyCommand): This function returns the version returned by 'Check for Updates' in Citrix Workspace app. https://citrix.com/ may show a later available version for download." } - $UpdateFeed = Invoke-EvergreenRestMethod @params - # Convert content to XML document - if ($null -ne $UpdateFeed) { + process { + # Read the Citrix Workspace app for updater feed for each OS in the list + $params = @{ + Uri = $res.Get.Update.Uri + UserAgent = $res.Get.Update.UserAgent + } + $UpdateFeed = Invoke-EvergreenRestMethod @params - # Filter the update feed for just the installers we want - $Installers = $UpdateFeed.Catalog.Installers | ` - Where-Object { $_.name -eq $res.Get.Update.FilterName } | ` - Select-Object -ExpandProperty $res.Get.Update.ExpandProperty + # Convert content to XML document + if ($null -ne $UpdateFeed) { - # Walk through each node to output details - foreach ($Installer in $Installers) { + # Filter the update feed for just the installers we want + $Installers = $UpdateFeed.Catalog.Installers | ` + Where-Object { $_.name -eq $res.Get.Update.FilterName } | ` + Select-Object -ExpandProperty $res.Get.Update.ExpandProperty - # Write a warning if Citrix is throttling updates - if ($Installer.Version -eq "0.0.0.0") { - Write-Warning -Message "$($MyInvocation.MyCommand): Citrix may be throttling availability of updates for $($Installer.ShortDescription -replace ':', '')." - } + # Walk through each node to output details + foreach ($Installer in $Installers) { + + # Write a warning if Citrix is throttling updates + if ($Installer.Version -eq "0.0.0.0") { + Write-Warning -Message "$($MyInvocation.MyCommand): Version '0.0.0.0' detected. Citrix may be throttling availability of updates for $($Installer.ShortDescription -replace ':', '')." + } - $PSObject = [PSCustomObject] @{ - Version = $Installer.Version - Stream = $Installer.Stream - Date = ConvertTo-DateTime -DateTime $Installer.StartDate -Pattern $res.Get.Update.DatePattern - #Title = $($Installer.ShortDescription -replace ":", "") - Size = $(if ($Installer.Size) { $Installer.Size } else { "Unknown" }) - Hash = $Installer.Hash - URI = "$($res.Get.Download.Uri)$($Installer.DownloadURL)" + $PSObject = [PSCustomObject] @{ + Version = $Installer.Version + Stream = $Installer.Stream + Date = ConvertTo-DateTime -DateTime $Installer.StartDate -Pattern $res.Get.Update.DatePattern + #Title = $($Installer.ShortDescription -replace ":", "") + Size = $(if ($Installer.Size) { $Installer.Size } else { "Unknown" }) + Hash = $Installer.Hash + URI = "$($res.Get.Download.Uri)$($Installer.DownloadURL)" + } + Write-Output -InputObject $PSObject } - Write-Output -InputObject $PSObject } } }