Skip to content

Commit 0fb1c95

Browse files
committed
Fix Omnissa Horizon Client
#678
1 parent 6c6ebfd commit 0fb1c95

File tree

4 files changed

+61
-100
lines changed

4 files changed

+61
-100
lines changed

Disabled/Get-VMwareHorizonClient.ps1

-23
This file was deleted.

Disabled/VMwareHorizonClient.json

-30
This file was deleted.
+33-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function Get-OmnissaHorizonClient {
22
<#
33
.NOTES
4-
Author: Aaron Parker
4+
Author: Aaron Parker, Dan Gough
55
Twitter: @stealthpuppy
66
#>
77
[OutputType([System.Management.Automation.PSObject])]
@@ -13,27 +13,40 @@
1313
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
1414
)
1515

16-
# Get the download group and id
17-
$Products = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri
18-
$Product = $Products.dlgEditionsLists | Where-Object { $_.name -match $res.Get.Update.Match }
16+
# $Output = Get-VMwareProductList -Name $res.Get.Download.ProductName | `
17+
# Get-VMwareProductDownload | `
18+
# Where-Object { $_.URI -match $res.Get.Download.MatchFileTypes } | `
19+
# Sort-Object -Property "ReleaseDate" | `
20+
# Select-Object -Last 1 | `
21+
# ForEach-Object { $_.Version = $_.Version -replace $res.Get.Download.ReplaceText, ""; $_ }
22+
# Write-Output -InputObject $Output
1923

20-
# Build the URL to the downloads list
21-
$Url = $res.Get.Download.Uri -replace "#cart", $Product.dlgList.code `
22-
-replace "#pid", $Product.dlgList.productId `
23-
-replace "#rpid", $Product.dlgList.releasePackageId
24+
$params = @{
25+
Uri = $res.Get.Download.Uri
26+
}
27+
$Response = Invoke-EvergreenRestMethod @params
28+
$Product = $Response.dlgEditionsLists.Where({ $_.name -eq $res.Get.Download.ProductName }).dlgList
29+
30+
$params = @{
31+
Uri = $res.Get.Download.QueryUri -replace "#ProductCode", $Product.code `
32+
-replace "#ProductId", $Product.productId `
33+
-replace "#PackageId", $Product.releasePackageId
34+
}
35+
$details = Invoke-EvergreenRestMethod @params
36+
37+
foreach ($File in $details.downloadFiles) {
2438

25-
# Get the download list
26-
$Downloads = Invoke-EvergreenRestMethod -Uri $Url
39+
$InternalVersion = [RegEx]::Match($File.thirdPartyDownloadUrl, $res.Get.Download.MatchVersion).Captures.Groups[1].Value
2740

28-
# Construct the output; Return the custom object to the pipeline
29-
foreach ($File in $Downloads.downloadFiles) {
30-
[PSCustomObject] @{
31-
Version = $File.version
32-
Build = $File.build
33-
Date = $File.releaseDate
34-
Sha256 = $File.sha256checksum
35-
Type = Get-FileType -File $File.thirdPartyDownloadUrl
36-
URI = $File.thirdPartyDownloadUrl
37-
} | Write-Output
41+
$PSObject = [PSCustomObject] @{
42+
Version = $File.version
43+
InternalVersion = "$InternalVersion-$($File.build)"
44+
Date = ConvertTo-DateTime -DateTime $File.releaseDate -Pattern $res.Get.Download.DateFormat
45+
Sha256 = $File.sha256checksum
46+
Size = $File.fileSize
47+
Type = Get-FileType -File $File.thirdPartyDownloadUrl
48+
URI = $File.thirdPartyDownloadUrl
49+
}
50+
Write-Output -InputObject $PSObject
3851
}
3952
}
+28-27
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
{
2-
"Name": "Omnissa Horizon Client",
3-
"Source": "https://customerconnect.omnissa.com/downloads/info/slug/desktop_end_user_computing/vmware_horizon_clients/horizon_8",
4-
"Get": {
5-
"Update": {
6-
"Uri": "https://customerconnect.omnissa.com/channel/public/api/v1.0/products/getRelatedDLGList?locale=en_US&category=desktop_end_user_computing&product=vmware_horizon_clients&version=horizon_8&dlgType=PRODUCT_BINARY",
7-
"Match": "Horizon Client for Windows"
8-
},
9-
"Download": {
10-
"Uri": "https://customerconnect.omnissa.com/channel/public/api/v1.0/dlg/details?locale=en_US&downloadGroup=#cart&productId=#pid&rPId=#rpid"
11-
}
12-
},
13-
"Install": {
14-
"Setup": "",
15-
"Physical": {
16-
"Arguments": "",
17-
"PostInstall": [
18-
19-
]
20-
},
21-
"Virtual": {
22-
"Arguments": "",
23-
"PostInstall": [
24-
25-
]
26-
}
27-
}
28-
}
2+
"Name": "Omnissa Horizon Client",
3+
"Source": "https://customerconnect.omnissa.com/downloads/info/slug/desktop_end_user_computing/omnissa_horizon_clients/8",
4+
"Get": {
5+
"Update": {
6+
"Uri": ""
7+
},
8+
"Download": {
9+
"Uri": "https://customerconnect.omnissa.com/channel/public/api/v1.0/products/getRelatedDLGList?locale=en_US&category=desktop_end_user_computing&product=omnissa_horizon_clients&version=8&dlgType=PRODUCT_BINARY",
10+
"ProductName": "Omnissa Horizon Client for Windows",
11+
"QueryUri": "https://customerconnect.omnissa.com/channel/public/api/v1.0/dlg/details?locale=en_US&downloadGroup=#ProductCode&productId=#ProductId&rPId=#PackageId",
12+
"MatchVersion": "(\\d+(\\.\\d+){1,3})",
13+
"MatchFileTypes": "\\.exe$|\\.msi$",
14+
"DateFormat": "yyyy-MM-dd",
15+
"ReplaceText": ""
16+
}
17+
},
18+
"Install": {
19+
"Setup": "",
20+
"Physical": {
21+
"Arguments": "",
22+
"PostInstall": []
23+
},
24+
"Virtual": {
25+
"Arguments": "",
26+
"PostInstall": []
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)