-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
Get-AdobeAcrobatReaderDC.ps1
59 lines (52 loc) · 2.44 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
56
57
58
59
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()) {
# Get the installer display names for the specified language
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 ($Product in $UpdateContent.products.reader) {
# Search for downloads for each display name returned for the language
$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", $Product.displayName -replace "#ShortLanguage", $language.Name -replace " ", "%20"
}
$DownloadContent = Invoke-EvergreenRestMethod @params
# Build the output object
if ($null -ne $DownloadContent) {
$PSObject = [PSCustomObject] @{
Version = $Product.version
Language = $LanguageFullName
Size = [System.Int32]$Product.fileSize
Architecture = Get-Architecture -String $DownloadContent.downloadURL
#Name = $Product.displayName
URI = $DownloadContent.downloadURL
}
Write-Output -InputObject $PSObject
}
}
}
}
#endregion
}