Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apps #777

Merged
merged 2 commits into from
Dec 3, 2024
Merged

Apps #777

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}
}
Loading