Skip to content

Commit

Permalink
Merge pull request #777 from aaronparker/apps
Browse files Browse the repository at this point in the history
Apps
  • Loading branch information
aaronparker authored Dec 3, 2024
2 parents 4195d04 + 28e75f6 commit 6498677
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 29 deletions.
58 changes: 32 additions & 26 deletions Evergreen/Apps/Get-CitrixWorkspaceApp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
6 changes: 3 additions & 3 deletions Evergreen/Apps/Get-QGIS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<no value>") { $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
}
}
}

0 comments on commit 6498677

Please sign in to comment.