forked from aaronparker/evergreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGet-AdobeAcrobatReaderDC.ps1
55 lines (48 loc) · 2.16 KB
/
Get-AdobeAcrobatReaderDC.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Function Get-AdobeAcrobatReaderDC {
<#
.SYNOPSIS
Gets the download URLs for Adobe Acrobat Reader DC Continuous track installers.
.NOTES
Author: Aaron Parker
Twitter: @stealthpuppy
.LINK
https://github.com/aaronparker/Evergreen
#>
[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])
)
#region Installer downloads
foreach ($language in $res.Get.Update.Languages.GetEnumerator()) {
Write-Verbose -Message "$($MyInvocation.MyCommand): Searching updates for language: $($language.Name)."
$params = @{
Uri = $res.Get.Update.Uri -replace "#Language", $language.Name
}
$UpdateContent = Invoke-EvergreenRestMethod @params
if ($Null -ne $UpdateContent) {
foreach ($item in $UpdateContent.products.reader) {
$LanguageFullName = $($res.Get.Update.Languages[$language.Key])
Write-Verbose -Message "$($MyInvocation.MyCommand): Searching downloads for language: $LanguageFullName, $($language.Name)."
$params = @{
Uri = $res.Get.Download.Uri -replace "#DisplayName", $item.displayName -replace "#ShortLanguage", $language.Name -replace " ", "%20"
}
$DownloadContent = Invoke-EvergreenRestMethod @params
if ($null -ne $DownloadContent) {
$PSObject = [PSCustomObject] @{
Version = $item.version
Language = $LanguageFullName
Architecture = Get-Architecture -String $DownloadContent.downloadURL
Name = $item.displayName
URI = $DownloadContent.downloadURL
}
Write-Output -InputObject $PSObject
}
}
}
}
#endregion
}