From 984d7665cfb832dce64ac6bb22b2589c7ffdae5e Mon Sep 17 00:00:00 2001 From: Martijn van Laar Date: Thu, 16 May 2024 13:16:34 +0200 Subject: [PATCH 01/14] Add MS OpenJDK 21 --- Evergreen/Apps/Get-MicrosoftOpenJDK21.ps1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Evergreen/Apps/Get-MicrosoftOpenJDK21.ps1 diff --git a/Evergreen/Apps/Get-MicrosoftOpenJDK21.ps1 b/Evergreen/Apps/Get-MicrosoftOpenJDK21.ps1 new file mode 100644 index 00000000..46599bdb --- /dev/null +++ b/Evergreen/Apps/Get-MicrosoftOpenJDK21.ps1 @@ -0,0 +1,18 @@ +function Get-MicrosoftOpenJDK21 { + <# + .NOTES + Author: Aaron Parker + Twitter: @stealthpuppy + #> + [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]) + ) + + $Output = Get-AdoptiumTemurin -res $res + Write-Output -InputObject $Output +} From 3cd3080a1d8dbbc5db32c70224479dc12853d781 Mon Sep 17 00:00:00 2001 From: Martijn van Laar Date: Thu, 16 May 2024 13:18:21 +0200 Subject: [PATCH 02/14] Create MicrosoftOpenJDK21.json --- Evergreen/Manifests/MicrosoftOpenJDK21.json | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Evergreen/Manifests/MicrosoftOpenJDK21.json diff --git a/Evergreen/Manifests/MicrosoftOpenJDK21.json b/Evergreen/Manifests/MicrosoftOpenJDK21.json new file mode 100644 index 00000000..e09566f8 --- /dev/null +++ b/Evergreen/Manifests/MicrosoftOpenJDK21.json @@ -0,0 +1,25 @@ + +{ + "Name": "Microsoft OpenJDK 21", + "Source": "https://www.microsoft.com/openjdk", + "Get": { + "Update": { + "Uri": "https://marketplace-api.adoptium.net/v1/assets/latestForVendors?feature_version=21&os=windows&vendor=microsoft", + "ContentType": "application/json", + "MatchImage": "jdk|jre", + "ResolveUri": true + } + }, + "Install": { + "Setup": "", + "Physical": { + "Arguments": "", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [] + } + } +} +MicrosoftOpenJDK17.json From 925132b3820dfb96a00fa58b0e9b292555497ad8 Mon Sep 17 00:00:00 2001 From: Martijn van Laar Date: Thu, 16 May 2024 13:30:20 +0200 Subject: [PATCH 03/14] fix cut and past in json --- Evergreen/Manifests/MicrosoftOpenJDK21.json | 1 - 1 file changed, 1 deletion(-) diff --git a/Evergreen/Manifests/MicrosoftOpenJDK21.json b/Evergreen/Manifests/MicrosoftOpenJDK21.json index e09566f8..ff694b89 100644 --- a/Evergreen/Manifests/MicrosoftOpenJDK21.json +++ b/Evergreen/Manifests/MicrosoftOpenJDK21.json @@ -22,4 +22,3 @@ } } } -MicrosoftOpenJDK17.json From 8ee1831f234a72dcdf180fba562852609db38e34 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sat, 18 May 2024 21:36:57 +1000 Subject: [PATCH 04/14] Update Get-FileZilla.ps1 --- Evergreen/Apps/Get-FileZilla.ps1 | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Evergreen/Apps/Get-FileZilla.ps1 b/Evergreen/Apps/Get-FileZilla.ps1 index 0d7da7d0..f14a9d29 100644 --- a/Evergreen/Apps/Get-FileZilla.ps1 +++ b/Evergreen/Apps/Get-FileZilla.ps1 @@ -8,10 +8,10 @@ function Get-FileZilla { Author: Aaron Parker Twitter: @stealthpuppy #> - [CmdletBinding(SupportsShouldProcess = $False)] + [CmdletBinding(SupportsShouldProcess = $false)] [OutputType([System.Management.Automation.PSObject])] param ( - [Parameter(Mandatory = $False, Position = 0)] + [Parameter(Mandatory = $false, Position = 0)] [ValidateNotNull()] [System.Management.Automation.PSObject] $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) @@ -19,21 +19,19 @@ function Get-FileZilla { # Query the update feed $params = @{ - Uri = $res.Get.Update.Uri - UserAgent = $res.Get.Update.UserAgent + Uri = $res.Get.Update.Uri + UserAgent = $res.Get.Update.UserAgent + Headers = @{ + Accept = "*/*" + } SkipCertificateCheck = $true - Raw = $true + Raw = $true } $Content = Invoke-EvergreenWebRequest @params # Convert the content to an object - try { - $Updates = $Content | ConvertFrom-Csv -Delimiter $res.Get.Update.Delimiter -Header $res.Get.Update.Headers | ` - Where-Object { $_.Channel -eq $res.Get.Update.Channel } - } - catch { - throw $_ - } + $Updates = $Content | ConvertFrom-Csv -Delimiter $res.Get.Update.Delimiter -Header $res.Get.Update.Headers | ` + Where-Object { $_.Channel -eq $res.Get.Update.Channel } # Output the object to the pipeline foreach ($Update in $Updates) { From 8e596c35682228fb6c0ab85e9128f3be0bd3d418 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 00:15:43 +1000 Subject: [PATCH 05/14] Update to return latest version #687 --- Evergreen/Apps/Get-MicrosoftSsms.ps1 | 27 ++++++++++---------------- Evergreen/Manifests/MicrosoftSsms.json | 2 +- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Evergreen/Apps/Get-MicrosoftSsms.ps1 b/Evergreen/Apps/Get-MicrosoftSsms.ps1 index 8b76dc3a..5533890c 100644 --- a/Evergreen/Apps/Get-MicrosoftSsms.ps1 +++ b/Evergreen/Apps/Get-MicrosoftSsms.ps1 @@ -8,7 +8,7 @@ function Get-MicrosoftSsms { Twitter: @stealthpuppy #> [OutputType([System.Management.Automation.PSObject])] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification="Product name is a plural")] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "Product name is a plural")] [CmdletBinding(SupportsShouldProcess = $false)] param ( [Parameter(Mandatory = $false, Position = 0)] @@ -17,30 +17,23 @@ function Get-MicrosoftSsms { $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) ) - # Resolve the SSMS update feed - $UpdateFeed = Resolve-SystemNetWebRequest -Uri $res.Get.Update.Uri + # Follow the https://go.microsoft.com/fwlink/?linkid= link to get to the update XML + $UpdateFeed = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri + if ($UpdateFeed -is [System.Xml.XmlElement]) { - # SQL Management Studio downloads/versions documentation - $params = @{ - Uri = $UpdateFeed.ResponseUri.AbsoluteUri - } - $Content = Invoke-EvergreenRestMethod @params - - if ($null -ne $Content) { - foreach ($entry in $Content.component) { + foreach ($Entry in $UpdateFeed) { foreach ($language in $res.Get.Download.Language.GetEnumerator()) { # Follow the download link which will return a 301 - $Uri = $res.Get.Download.Uri -replace $res.Get.Download.ReplaceText, $res.Get.Download.Language[$language.key] + $Query = "?clcid=" + $Uri = "$($Entry.link.href)$($Query)$($res.Get.Download.Language[$language.key])" $ResponseUri = Resolve-SystemNetWebRequest -Uri $Uri - - # Check returned URL. It should be a go.microsoft.com/fwlink/?linkid style link - if ($null -ne $ResponseUri) { + if ($ResponseUri.ResponseUri.AbsoluteUri -eq $true) { # Construct the output; Return the custom object to the pipeline $PSObject = [PSCustomObject] @{ - Version = $entry.version - Date = ConvertTo-DateTime -DateTime ($Content.updated.Split(".")[0]) -Pattern $res.Get.Update.DatePattern + Version = $Entry.component.version + Date = ConvertTo-DateTime -DateTime ($UpdateFeed.updated.Split(".")[0]) -Pattern $res.Get.Update.DatePattern Language = $language.key URI = $ResponseUri.ResponseUri.AbsoluteUri } diff --git a/Evergreen/Manifests/MicrosoftSsms.json b/Evergreen/Manifests/MicrosoftSsms.json index b26c8a0f..16047d78 100644 --- a/Evergreen/Manifests/MicrosoftSsms.json +++ b/Evergreen/Manifests/MicrosoftSsms.json @@ -3,7 +3,7 @@ "Source": "https://go.microsoft.com/fwlink/?LinkId=531355", "Get": { "Update": { - "Uri": "https://go.microsoft.com/fwlink/?linkid=2264111", + "Uri": "https://go.microsoft.com/fwlink/?linkid=2267020", "DatePattern": "yyyy-MM-ddTHH:mm:ss" }, "Download": { From e55988d19cbaeabc419745f72e0257d02f9ae7ae Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 10:57:37 +1000 Subject: [PATCH 06/14] #686 #685 Update URLs, update Resolve-MicrosoftFwLink --- .../Get-MicrosoftODBCDriverForSQLServer.ps1 | 7 ++- .../Get-MicrosoftOLEDBDriverForSQLServer.ps1 | 7 ++- .../MicrosoftODBCDriverForSQLServer.json | 6 +- .../MicrosoftOLEDBDriverForSQLServer.json | 6 +- Evergreen/Shared/Get-MicrosoftFwLink.ps1 | 48 --------------- Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 | 59 +++++++++++++++++++ 6 files changed, 75 insertions(+), 58 deletions(-) delete mode 100644 Evergreen/Shared/Get-MicrosoftFwLink.ps1 create mode 100644 Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 diff --git a/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1 b/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1 index e3b0cb08..c56c839c 100644 --- a/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1 +++ b/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1 @@ -12,6 +12,9 @@ function Get-MicrosoftODBCDriverForSQLServer { $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) ) - $Output = Get-MicrosoftFwLink -res $res - Write-Output -InputObject $Output + $params = @{ + Uri = $res.Get.Download.Uri + MaximumRedirection = $res.Get.Download.MaximumRedirection + } + Resolve-MicrosoftFwLink @params | Write-Output } diff --git a/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1 b/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1 index 1e7ff798..dd3ba9d6 100644 --- a/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1 +++ b/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1 @@ -12,6 +12,9 @@ function Get-MicrosoftOLEDBDriverForSQLServer { $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) ) - $Output = Get-MicrosoftFwLink -res $res - Write-Output -InputObject $Output + $params = @{ + Uri = $res.Get.Download.Uri + MaximumRedirection = $res.Get.Download.MaximumRedirection + } + Resolve-MicrosoftFwLink @params | Write-Output } diff --git a/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json b/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json index 7d610b78..cbe36c7a 100644 --- a/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json +++ b/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json @@ -7,9 +7,9 @@ }, "Download": { "Uri": [ - "https://go.microsoft.com/fwlink/?linkid=2249006", - "https://go.microsoft.com/fwlink/?linkid=2249005", - "https://go.microsoft.com/fwlink/?linkid=2248720" + "https://go.microsoft.com/fwlink/?linkid=2266640", + "https://go.microsoft.com/fwlink/?linkid=2266742", + "https://go.microsoft.com/fwlink/?linkid=2266837" ], "MaximumRedirection": 3, "DatePattern": "d/M/yyyy" diff --git a/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json b/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json index 04a78707..75290014 100644 --- a/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json +++ b/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json @@ -7,9 +7,9 @@ }, "Download": { "Uri": [ - "https://go.microsoft.com/fwlink/?linkid=2248728", - "https://go.microsoft.com/fwlink/?linkid=2249102", - "https://go.microsoft.com/fwlink/?linkid=2249103" + "https://go.microsoft.com/fwlink/?linkid=2266674", + "https://go.microsoft.com/fwlink/?linkid=2266883", + "https://go.microsoft.com/fwlink/?linkid=2266884" ], "MaximumRedirection": 3, "DatePattern": "d/M/yyyy" diff --git a/Evergreen/Shared/Get-MicrosoftFwLink.ps1 b/Evergreen/Shared/Get-MicrosoftFwLink.ps1 deleted file mode 100644 index 5b87d541..00000000 --- a/Evergreen/Shared/Get-MicrosoftFwLink.ps1 +++ /dev/null @@ -1,48 +0,0 @@ -function Get-MicrosoftFwLink { - <# - .SYNOPSIS - Resolves https://go.microsoft.com/fwlink URLs - - .NOTES - Author: Aaron Parker - Twitter: @stealthpuppy - #> - [OutputType([System.Management.Automation.PSObject])] - [CmdletBinding(SupportsShouldProcess = $false)] - param ( - [Parameter(Mandatory = $false, Position = 0)] - [ValidateNotNullOrEmpty()] - [System.Management.Automation.PSObject] $res - ) - - process { - foreach ($Uri in $res.Get.Download.Uri) { - - # Resolve the URL - $params = @{ - Uri = $Uri - MaximumRedirection = $res.Get.Download.MaximumRedirection - } - $ResolvedUrl = Resolve-SystemNetWebRequest @params - - try { - # Find the version number - $Version = [RegEx]::Match($ResolvedUrl.ResponseUri.AbsoluteUri, "(\d+(\.\d+){1,4}).*").Captures.Groups[1].Value - } - catch { - Write-Warning -Message "$($MyInvocation.MyCommand): Failed to match version number from: $($ResolvedUrl.ResponseUri.AbsoluteUri)." - } - - # Output a version object - $Output = [PSCustomObject]@{ - Version = $Version - Date = $ResolvedUrl.LastModified #ConvertTo-DateTime -Date $ResolvedUrl.LastModified -Pattern $res.Get.Download.DatePattern - Size = $ResolvedUrl.ContentLength - Architecture = Get-Architecture -String $ResolvedUrl.ResponseUri.AbsoluteUri - Type = Get-FileType -File $ResolvedUrl.ResponseUri.AbsoluteUri - URI = $ResolvedUrl.ResponseUri.AbsoluteUri - } - Write-Output -InputObject $Output - } - } -} diff --git a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 new file mode 100644 index 00000000..0fa6cf02 --- /dev/null +++ b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 @@ -0,0 +1,59 @@ +function Resolve-MicrosoftFwLink { + <# + .SYNOPSIS + Resolves https://go.microsoft.com/fwlink URLs + + .NOTES + Author: Aaron Parker + Twitter: @stealthpuppy + #> + [OutputType([System.Management.Automation.PSObject])] + [CmdletBinding(SupportsShouldProcess = $false)] + param ( + [Parameter(Mandatory = $true, Position = 0)] + [ValidateScript( { + if ($_ -match "^(https:\/\/go\.microsoft\.com\/fwlink\/\?linkid=)([0-9]+)$") { $true } + else { + throw "'$_' must be in the format 'https://go.microsoft.com/fwlink/?linkid=2248728'." + } + })] + [System.String[]] $Uri, + + [Parameter()] + [ValidateNotNullOrEmpty()] + [System.Int32] $MaximumRedirection = 2 + ) + + process { + foreach ($Url in $Uri) { + + # Resolve the URL + $params = @{ + Uri = $Url + MaximumRedirection = $MaximumRedirection + } + $ResolvedUrl = Resolve-SystemNetWebRequest @params + if ($ResponseUri.ResponseUri.AbsoluteUri -eq $true) { + + try { + # Find the version number + $Version = [RegEx]::Match($ResolvedUrl.ResponseUri.AbsoluteUri, "(\d+(\.\d+){1,4}).*").Captures.Groups[1].Value + } + catch { + $Version = "Unknown" + Write-Warning -Message "$($MyInvocation.MyCommand): Failed to match version number from: $($ResolvedUrl.ResponseUri.AbsoluteUri)." + } + + # Output a version object + [PSCustomObject]@{ + Version = $Version + Date = $ResolvedUrl.LastModified #ConvertTo-DateTime -Date $ResolvedUrl.LastModified -Pattern $res.Get.Download.DatePattern + Size = $ResolvedUrl.ContentLength + Architecture = Get-Architecture -String $ResolvedUrl.ResponseUri.AbsoluteUri + Type = Get-FileType -File $ResolvedUrl.ResponseUri.AbsoluteUri + URI = $ResolvedUrl.ResponseUri.AbsoluteUri + } | Write-Output + } + } + } +} From 8376fc733c89ff460956929225b0ada6b63511ab Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 11:46:11 +1000 Subject: [PATCH 07/14] #686 #685 Add support for languages --- .../Get-MicrosoftODBCDriverForSQLServer.ps1 | 16 ++++++-- .../Get-MicrosoftOLEDBDriverForSQLServer.ps1 | 16 ++++++-- .../MicrosoftODBCDriverForSQLServer.json | 13 +++++++ .../MicrosoftOLEDBDriverForSQLServer.json | 13 +++++++ Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 | 39 +++++++++---------- 5 files changed, 69 insertions(+), 28 deletions(-) diff --git a/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1 b/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1 index c56c839c..f608b0af 100644 --- a/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1 +++ b/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1 @@ -12,9 +12,17 @@ function Get-MicrosoftODBCDriverForSQLServer { $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) ) - $params = @{ - Uri = $res.Get.Download.Uri - MaximumRedirection = $res.Get.Download.MaximumRedirection + foreach ($language in $res.Get.Download.Language.GetEnumerator()) { + foreach ($Url in $res.Get.Download.Uri) { + + # Construct the URL to include the language + $Query = "&clcid=" + $Uri = "$($Url)$($Query)$($res.Get.Download.Language[$language.key])" + $params = @{ + Uri = $Uri + MaximumRedirection = $res.Get.Download.MaximumRedirection + } + Resolve-MicrosoftFwLink @params | ForEach-Object { $_.Language = $language.key; $_ } | Write-Output + } } - Resolve-MicrosoftFwLink @params | Write-Output } diff --git a/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1 b/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1 index dd3ba9d6..af222c43 100644 --- a/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1 +++ b/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1 @@ -12,9 +12,17 @@ function Get-MicrosoftOLEDBDriverForSQLServer { $res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1]) ) - $params = @{ - Uri = $res.Get.Download.Uri - MaximumRedirection = $res.Get.Download.MaximumRedirection + foreach ($language in $res.Get.Download.Language.GetEnumerator()) { + foreach ($Url in $res.Get.Download.Uri) { + + # Construct the URL to include the language + $Query = "&clcid=" + $Uri = "$($Url)$($Query)$($res.Get.Download.Language[$language.key])" + $params = @{ + Uri = $Uri + MaximumRedirection = $res.Get.Download.MaximumRedirection + } + Resolve-MicrosoftFwLink @params | ForEach-Object { $_.Language = $language.key; $_ } | Write-Output + } } - Resolve-MicrosoftFwLink @params | Write-Output } diff --git a/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json b/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json index cbe36c7a..059afc2d 100644 --- a/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json +++ b/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json @@ -11,6 +11,19 @@ "https://go.microsoft.com/fwlink/?linkid=2266742", "https://go.microsoft.com/fwlink/?linkid=2266837" ], + "Language": { + "English": "0x409", + "French": "0x40c", + "German": "0x407", + "Italian": "0x410", + "Japanese": "0x411", + "Korean": "0x412", + "Portuguese (Brazil)": "0x416", + "Russian": "0x419", + "Spanish": "0x40a", + "Chinese (Simplified)": "0x804", + "Chinese (Traditional)": "0x404" + }, "MaximumRedirection": 3, "DatePattern": "d/M/yyyy" } diff --git a/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json b/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json index 75290014..35e52315 100644 --- a/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json +++ b/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json @@ -11,6 +11,19 @@ "https://go.microsoft.com/fwlink/?linkid=2266883", "https://go.microsoft.com/fwlink/?linkid=2266884" ], + "Language": { + "English": "0x409", + "French": "0x40c", + "German": "0x407", + "Italian": "0x410", + "Japanese": "0x411", + "Korean": "0x412", + "Portuguese (Brazil)": "0x416", + "Russian": "0x419", + "Spanish": "0x40a", + "Chinese (Simplified)": "0x804", + "Chinese (Traditional)": "0x404" + }, "MaximumRedirection": 3, "DatePattern": "d/M/yyyy" } diff --git a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 index 0fa6cf02..36c15b46 100644 --- a/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 +++ b/Evergreen/Shared/Resolve-MicrosoftFwLink.ps1 @@ -12,7 +12,7 @@ function Resolve-MicrosoftFwLink { param ( [Parameter(Mandatory = $true, Position = 0)] [ValidateScript( { - if ($_ -match "^(https:\/\/go\.microsoft\.com\/fwlink\/\?linkid=)([0-9]+)$") { $true } + if ($_ -match "^(https:\/\/go\.microsoft\.com\/fwlink\/\?linkid=)([0-9]+).*$") { $true } else { throw "'$_' must be in the format 'https://go.microsoft.com/fwlink/?linkid=2248728'." } @@ -33,27 +33,26 @@ function Resolve-MicrosoftFwLink { MaximumRedirection = $MaximumRedirection } $ResolvedUrl = Resolve-SystemNetWebRequest @params - if ($ResponseUri.ResponseUri.AbsoluteUri -eq $true) { - try { - # Find the version number - $Version = [RegEx]::Match($ResolvedUrl.ResponseUri.AbsoluteUri, "(\d+(\.\d+){1,4}).*").Captures.Groups[1].Value - } - catch { - $Version = "Unknown" - Write-Warning -Message "$($MyInvocation.MyCommand): Failed to match version number from: $($ResolvedUrl.ResponseUri.AbsoluteUri)." - } - - # Output a version object - [PSCustomObject]@{ - Version = $Version - Date = $ResolvedUrl.LastModified #ConvertTo-DateTime -Date $ResolvedUrl.LastModified -Pattern $res.Get.Download.DatePattern - Size = $ResolvedUrl.ContentLength - Architecture = Get-Architecture -String $ResolvedUrl.ResponseUri.AbsoluteUri - Type = Get-FileType -File $ResolvedUrl.ResponseUri.AbsoluteUri - URI = $ResolvedUrl.ResponseUri.AbsoluteUri - } | Write-Output + try { + # Find the version number + $Version = [RegEx]::Match($ResolvedUrl.ResponseUri.AbsoluteUri, "(\d+(\.\d+){1,4}).*").Captures.Groups[1].Value } + catch { + $Version = "Unknown" + Write-Warning -Message "$($MyInvocation.MyCommand): Failed to match version number from: $($ResolvedUrl.ResponseUri.AbsoluteUri)." + } + + # Output a version object + [PSCustomObject]@{ + Version = $Version + Date = $ResolvedUrl.LastModified.ToShortDateString() + Size = $ResolvedUrl.ContentLength + Language = "Unknown" + Architecture = Get-Architecture -String $ResolvedUrl.ResponseUri.AbsoluteUri + Type = Get-FileType -File $ResolvedUrl.ResponseUri.AbsoluteUri + URI = $ResolvedUrl.ResponseUri.AbsoluteUri + } | Write-Output } } } From b9387a2157ae8b10408e1454abe432cb303eaf6c Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 13:20:16 +1000 Subject: [PATCH 08/14] Add AzulZulu21 --- Evergreen/Apps/Get-AzulZulu21.ps1 | 18 ++++++++++++++++++ Evergreen/Manifests/AzulZulu21.json | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Evergreen/Apps/Get-AzulZulu21.ps1 create mode 100644 Evergreen/Manifests/AzulZulu21.json diff --git a/Evergreen/Apps/Get-AzulZulu21.ps1 b/Evergreen/Apps/Get-AzulZulu21.ps1 new file mode 100644 index 00000000..ffe85bfc --- /dev/null +++ b/Evergreen/Apps/Get-AzulZulu21.ps1 @@ -0,0 +1,18 @@ +function Get-AzulZulu21 { + <# + .NOTES + Author: Aaron Parker + Twitter: @stealthpuppy + #> + [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]) + ) + + $Output = Get-AdoptiumTemurin -res $res + Write-Output -InputObject $Output +} diff --git a/Evergreen/Manifests/AzulZulu21.json b/Evergreen/Manifests/AzulZulu21.json new file mode 100644 index 00000000..d561fd9a --- /dev/null +++ b/Evergreen/Manifests/AzulZulu21.json @@ -0,0 +1,23 @@ +{ + "Name": "Azul Zulu 21", + "Source": "https://www.azul.com/downloads/#zulu", + "Get": { + "Update": { + "Uri": "https://marketplace-api.adoptium.net/v1/assets/latestForVendors?feature_version=21&os=windows&vendor=azul", + "ContentType": "application/json", + "MatchImage": "jdk|jre", + "ResolveUri": false + } + }, + "Install": { + "Setup": "OpenJDK*.msi", + "Physical": { + "Arguments": "", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [] + } + } +} From e1c9108066d61b5553017bf2010a19efdbc61c0f Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 13:22:31 +1000 Subject: [PATCH 09/14] Add RedHatOpenJDK21 --- Evergreen/Apps/Get-RedHatOpenJDK21.ps1 | 18 ++++++++++++++++++ Evergreen/Manifests/RedHatOpenJDK21.json | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Evergreen/Apps/Get-RedHatOpenJDK21.ps1 create mode 100644 Evergreen/Manifests/RedHatOpenJDK21.json diff --git a/Evergreen/Apps/Get-RedHatOpenJDK21.ps1 b/Evergreen/Apps/Get-RedHatOpenJDK21.ps1 new file mode 100644 index 00000000..8829c397 --- /dev/null +++ b/Evergreen/Apps/Get-RedHatOpenJDK21.ps1 @@ -0,0 +1,18 @@ +function Get-RedHatOpenJDK21 { + <# + .NOTES + Author: Aaron Parker + Twitter: @stealthpuppy + #> + [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]) + ) + + $Output = Get-AdoptiumTemurin -res $res + Write-Output -InputObject $Output +} diff --git a/Evergreen/Manifests/RedHatOpenJDK21.json b/Evergreen/Manifests/RedHatOpenJDK21.json new file mode 100644 index 00000000..805d1368 --- /dev/null +++ b/Evergreen/Manifests/RedHatOpenJDK21.json @@ -0,0 +1,23 @@ +{ + "Name": "Red Hat OpenJDK 21", + "Source": "https://developers.redhat.com/products/openjdk/overview", + "Get": { + "Update": { + "Uri": "https://marketplace-api.adoptium.net/v1/assets/latestForVendors?feature_version=21&os=windows&vendor=redhat", + "ContentType": "application/json", + "MatchImage": "jdk|jre", + "ResolveUri": false + } + }, + "Install": { + "Setup": "OpenJDK*.msi", + "Physical": { + "Arguments": "", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [] + } + } +} From eb721b4952360822745d3f85ba1dfac52cfe1ef4 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 13:26:08 +1000 Subject: [PATCH 10/14] Add AdoptiumTemurin21 --- Evergreen/Apps/Get-AdoptiumTemurin21.ps1 | 18 ++++++++++++++++++ Evergreen/Manifests/AdoptiumTemurin21.json | 22 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Evergreen/Apps/Get-AdoptiumTemurin21.ps1 create mode 100644 Evergreen/Manifests/AdoptiumTemurin21.json diff --git a/Evergreen/Apps/Get-AdoptiumTemurin21.ps1 b/Evergreen/Apps/Get-AdoptiumTemurin21.ps1 new file mode 100644 index 00000000..2fa7ad13 --- /dev/null +++ b/Evergreen/Apps/Get-AdoptiumTemurin21.ps1 @@ -0,0 +1,18 @@ +Function Get-AdoptiumTemurin21 { + <# + .NOTES + Author: Aaron Parker + Twitter: @stealthpuppy + #> + [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]) + ) + + $Output = Get-AdoptiumTemurin -res $res + Write-Output -InputObject $Output +} diff --git a/Evergreen/Manifests/AdoptiumTemurin21.json b/Evergreen/Manifests/AdoptiumTemurin21.json new file mode 100644 index 00000000..fd2b5da8 --- /dev/null +++ b/Evergreen/Manifests/AdoptiumTemurin21.json @@ -0,0 +1,22 @@ +{ + "Name": "Adoptium Temurin 21", + "Source": "https://adoptium.net/", + "Get": { + "Update": { + "Uri": "https://api.adoptium.net/v3/assets/latest/21/hotspot?os=windows&jvm_impl=hotspot", + "ContentType": "application/json", + "MatchImage": "jdk|jre" + } + }, + "Install": { + "Setup": "OpenJDK*.msi", + "Physical": { + "Arguments": "", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [] + } + } +} From 248da898ed284e025c67c5f9d8e07d2ff40ff54e Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 18:31:20 +1000 Subject: [PATCH 11/14] #685 Add MicrosoftODBCDriverForSQLServer17 --- .../Get-MicrosoftODBCDriverForSQLServer17.ps1 | 28 +++++++++++++ .../MicrosoftODBCDriverForSQLServer17.json | 42 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer17.ps1 create mode 100644 Evergreen/Manifests/MicrosoftODBCDriverForSQLServer17.json diff --git a/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer17.ps1 b/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer17.ps1 new file mode 100644 index 00000000..dbc10baf --- /dev/null +++ b/Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer17.ps1 @@ -0,0 +1,28 @@ +function Get-MicrosoftODBCDriverForSQLServer17 { + <# + .SYNOPSIS + + #> + [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]) + ) + + foreach ($language in $res.Get.Download.Language.GetEnumerator()) { + foreach ($Url in $res.Get.Download.Uri) { + + # Construct the URL to include the language + $Query = "&clcid=" + $Uri = "$($Url)$($Query)$($res.Get.Download.Language[$language.key])" + $params = @{ + Uri = $Uri + MaximumRedirection = $res.Get.Download.MaximumRedirection + } + Resolve-MicrosoftFwLink @params | ForEach-Object { $_.Language = $language.key; $_ } | Write-Output + } + } +} diff --git a/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer17.json b/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer17.json new file mode 100644 index 00000000..6f13a3ed --- /dev/null +++ b/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer17.json @@ -0,0 +1,42 @@ +{ + "Name": "Microsoft ODBC Driver for SQL Server 17.x", + "Source": "https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server", + "Get": { + "Update": { + "Uri": "" + }, + "Download": { + "Uri": [ + "https://go.microsoft.com/fwlink/?linkid=2266337", + "https://go.microsoft.com/fwlink/?linkid=2266446" + ], + "Language": { + "English": "0x409", + "French": "0x40c", + "German": "0x407", + "Italian": "0x410", + "Japanese": "0x411", + "Korean": "0x412", + "Portuguese (Brazil)": "0x416", + "Russian": "0x419", + "Spanish": "0x40a", + "Chinese (Simplified)": "0x804", + "Chinese (Traditional)": "0x404" + }, + "MaximumRedirection": 3, + "DatePattern": "d/M/yyyy" + } + }, + "Install": { + "Setup": "", + "Preinstall": "", + "Physical": { + "Arguments": "", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [] + } + } +} From 9540ff3c90c433593b2a7e14052809f37a182251 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 18:40:31 +1000 Subject: [PATCH 12/14] #686 Add MicrosoftOLEDBDriverForSQLServer18 --- ...Get-MicrosoftOLEDBDriverForSQLServer18.ps1 | 28 +++++++++++++ .../MicrosoftODBCDriverForSQLServer.json | 2 +- .../MicrosoftOLEDBDriverForSQLServer.json | 2 +- .../MicrosoftOLEDBDriverForSQLServer18.json | 42 +++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer18.ps1 create mode 100644 Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer18.json diff --git a/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer18.ps1 b/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer18.ps1 new file mode 100644 index 00000000..ff7a6a93 --- /dev/null +++ b/Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer18.ps1 @@ -0,0 +1,28 @@ +function Get-MicrosoftOLEDBDriverForSQLServer18 { + <# + .SYNOPSIS + + #> + [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]) + ) + + foreach ($language in $res.Get.Download.Language.GetEnumerator()) { + foreach ($Url in $res.Get.Download.Uri) { + + # Construct the URL to include the language + $Query = "&clcid=" + $Uri = "$($Url)$($Query)$($res.Get.Download.Language[$language.key])" + $params = @{ + Uri = $Uri + MaximumRedirection = $res.Get.Download.MaximumRedirection + } + Resolve-MicrosoftFwLink @params | ForEach-Object { $_.Language = $language.key; $_ } | Write-Output + } + } +} diff --git a/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json b/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json index 059afc2d..27859399 100644 --- a/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json +++ b/Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json @@ -1,5 +1,5 @@ { - "Name": "Microsoft ODBC Driver for SQL Server", + "Name": "Microsoft ODBC Driver for SQL Server (latest)", "Source": "https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server", "Get": { "Update": { diff --git a/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json b/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json index 35e52315..f6c512f6 100644 --- a/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json +++ b/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer.json @@ -1,5 +1,5 @@ { - "Name": "Microsoft OLE DB Driver for SQL Server", + "Name": "Microsoft OLE DB Driver for SQL Server (latest)", "Source": "https://learn.microsoft.com/en-us/sql/connect/oledb/download-oledb-driver-for-sql-server", "Get": { "Update": { diff --git a/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer18.json b/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer18.json new file mode 100644 index 00000000..46199d6e --- /dev/null +++ b/Evergreen/Manifests/MicrosoftOLEDBDriverForSQLServer18.json @@ -0,0 +1,42 @@ +{ + "Name": "Microsoft OLE DB Driver for SQL Server 18", + "Source": "https://learn.microsoft.com/en-us/sql/connect/oledb/release-notes-for-oledb-driver-for-sql-server?view=sql-server-ver16#previous-releases", + "Get": { + "Update": { + "Uri": "" + }, + "Download": { + "Uri": [ + "https://go.microsoft.com/fwlink/?linkid=2266757", + "https://go.microsoft.com/fwlink/?linkid=2266858" + ], + "Language": { + "English": "0x409", + "French": "0x40c", + "German": "0x407", + "Italian": "0x410", + "Japanese": "0x411", + "Korean": "0x412", + "Portuguese (Brazil)": "0x416", + "Russian": "0x419", + "Spanish": "0x40a", + "Chinese (Simplified)": "0x804", + "Chinese (Traditional)": "0x404" + }, + "MaximumRedirection": 3, + "DatePattern": "d/M/yyyy" + } + }, + "Install": { + "Setup": "", + "Preinstall": "", + "Physical": { + "Arguments": "", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [] + } + } +} \ No newline at end of file From ddae317da26acb9a70d2a7be05ec7cc5f789e692 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 19 May 2024 20:17:33 +1000 Subject: [PATCH 13/14] Remove apps #678 --- {Evergreen/Apps => Disabled}/Get-VMwareHorizonClient.ps1 | 0 {Evergreen/Apps => Disabled}/Get-VMwareOSOptimizationTool.ps1 | 0 {Evergreen/Apps => Disabled}/Get-VMwareSDWANClient.ps1 | 0 {Evergreen/Apps => Disabled}/Get-VMwareWorkstationPlayer.ps1 | 0 {Evergreen/Apps => Disabled}/Get-VMwareWorkstationPro.ps1 | 0 {Evergreen/Manifests => Disabled}/VMwareHorizonClient.json | 0 {Evergreen/Manifests => Disabled}/VMwareOSOptimizationTool.json | 0 {Evergreen/Manifests => Disabled}/VMwareSDWANClient.json | 0 {Evergreen/Manifests => Disabled}/VMwareWorkstationPlayer.json | 0 {Evergreen/Manifests => Disabled}/VMwareWorkstationPro.json | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename {Evergreen/Apps => Disabled}/Get-VMwareHorizonClient.ps1 (100%) rename {Evergreen/Apps => Disabled}/Get-VMwareOSOptimizationTool.ps1 (100%) rename {Evergreen/Apps => Disabled}/Get-VMwareSDWANClient.ps1 (100%) rename {Evergreen/Apps => Disabled}/Get-VMwareWorkstationPlayer.ps1 (100%) rename {Evergreen/Apps => Disabled}/Get-VMwareWorkstationPro.ps1 (100%) rename {Evergreen/Manifests => Disabled}/VMwareHorizonClient.json (100%) rename {Evergreen/Manifests => Disabled}/VMwareOSOptimizationTool.json (100%) rename {Evergreen/Manifests => Disabled}/VMwareSDWANClient.json (100%) rename {Evergreen/Manifests => Disabled}/VMwareWorkstationPlayer.json (100%) rename {Evergreen/Manifests => Disabled}/VMwareWorkstationPro.json (100%) diff --git a/Evergreen/Apps/Get-VMwareHorizonClient.ps1 b/Disabled/Get-VMwareHorizonClient.ps1 similarity index 100% rename from Evergreen/Apps/Get-VMwareHorizonClient.ps1 rename to Disabled/Get-VMwareHorizonClient.ps1 diff --git a/Evergreen/Apps/Get-VMwareOSOptimizationTool.ps1 b/Disabled/Get-VMwareOSOptimizationTool.ps1 similarity index 100% rename from Evergreen/Apps/Get-VMwareOSOptimizationTool.ps1 rename to Disabled/Get-VMwareOSOptimizationTool.ps1 diff --git a/Evergreen/Apps/Get-VMwareSDWANClient.ps1 b/Disabled/Get-VMwareSDWANClient.ps1 similarity index 100% rename from Evergreen/Apps/Get-VMwareSDWANClient.ps1 rename to Disabled/Get-VMwareSDWANClient.ps1 diff --git a/Evergreen/Apps/Get-VMwareWorkstationPlayer.ps1 b/Disabled/Get-VMwareWorkstationPlayer.ps1 similarity index 100% rename from Evergreen/Apps/Get-VMwareWorkstationPlayer.ps1 rename to Disabled/Get-VMwareWorkstationPlayer.ps1 diff --git a/Evergreen/Apps/Get-VMwareWorkstationPro.ps1 b/Disabled/Get-VMwareWorkstationPro.ps1 similarity index 100% rename from Evergreen/Apps/Get-VMwareWorkstationPro.ps1 rename to Disabled/Get-VMwareWorkstationPro.ps1 diff --git a/Evergreen/Manifests/VMwareHorizonClient.json b/Disabled/VMwareHorizonClient.json similarity index 100% rename from Evergreen/Manifests/VMwareHorizonClient.json rename to Disabled/VMwareHorizonClient.json diff --git a/Evergreen/Manifests/VMwareOSOptimizationTool.json b/Disabled/VMwareOSOptimizationTool.json similarity index 100% rename from Evergreen/Manifests/VMwareOSOptimizationTool.json rename to Disabled/VMwareOSOptimizationTool.json diff --git a/Evergreen/Manifests/VMwareSDWANClient.json b/Disabled/VMwareSDWANClient.json similarity index 100% rename from Evergreen/Manifests/VMwareSDWANClient.json rename to Disabled/VMwareSDWANClient.json diff --git a/Evergreen/Manifests/VMwareWorkstationPlayer.json b/Disabled/VMwareWorkstationPlayer.json similarity index 100% rename from Evergreen/Manifests/VMwareWorkstationPlayer.json rename to Disabled/VMwareWorkstationPlayer.json diff --git a/Evergreen/Manifests/VMwareWorkstationPro.json b/Disabled/VMwareWorkstationPro.json similarity index 100% rename from Evergreen/Manifests/VMwareWorkstationPro.json rename to Disabled/VMwareWorkstationPro.json From 337ca91a6083d7a90965ca165558a98ff6c9918f Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Tue, 21 May 2024 11:11:11 +1000 Subject: [PATCH 14/14] Add Proxyman --- Evergreen/Apps/Get-Proxyman.ps1 | 37 ++++++++++++++++++++++ Evergreen/Manifests/Proxyman.json | 26 +++++++++++++++ Evergreen/Shared/Get-GitHubRepoRelease.ps1 | 1 + 3 files changed, 64 insertions(+) create mode 100644 Evergreen/Apps/Get-Proxyman.ps1 create mode 100644 Evergreen/Manifests/Proxyman.json diff --git a/Evergreen/Apps/Get-Proxyman.ps1 b/Evergreen/Apps/Get-Proxyman.ps1 new file mode 100644 index 00000000..fb8d830e --- /dev/null +++ b/Evergreen/Apps/Get-Proxyman.ps1 @@ -0,0 +1,37 @@ +function Get-Proxyman { + <# + .NOTES + Author: Aaron Parker + Twitter: @stealthpuppy + #> + [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]) + ) + + # Pass the repo releases API URL and return a formatted object + # Return the version only because the download is tagged as Linux + $params = @{ + Uri = $res.Get.Update.Uri + MatchVersion = $res.Get.Update.MatchVersion + Filter = $res.Get.Update.MatchFileTypes + ReturnVersionOnly = $true + } + $LatestVersion = Get-GitHubRepoRelease @params + + # Resolve the evergreen download URL + $Url = Resolve-SystemNetWebRequest -Uri $res.Get.Download.Uri + + # Return a formatted object to the pipeline + [PSCustomObject]@{ + Version = $LatestVersion.Version + Date = $Url.LastModified.ToShortDateString() + Size = $Url.ContentLength + Type = Get-FileType -File $Url.ResponseUri.AbsoluteUri + URI = $Url.ResponseUri.AbsoluteUri + } | Write-Output +} diff --git a/Evergreen/Manifests/Proxyman.json b/Evergreen/Manifests/Proxyman.json new file mode 100644 index 00000000..716fe72d --- /dev/null +++ b/Evergreen/Manifests/Proxyman.json @@ -0,0 +1,26 @@ +{ + "Name": "Proxyman", + "Source": "https://proxyman.io/", + "Get": { + "Update": { + "Uri": "https://api.github.com/repos/ProxymanApp/proxyman-windows-linux/releases/latest", + "MatchVersion": "(\\d+(\\.\\d+){1,4}).*", + "MatchFileTypes": "\\.exe$|\\.msi$" + }, + "Download": { + "Uri": "https://proxyman.io/release/windows/Proxyman_latest.dmg" + } + }, + "Install": { + "Setup": "", + "Preinstall": "", + "Physical": { + "Arguments": "/quiet /norestart", + "PostInstall": [] + }, + "Virtual": { + "Arguments": "/quiet /norestart", + "PostInstall": [] + } + } +} \ No newline at end of file diff --git a/Evergreen/Shared/Get-GitHubRepoRelease.ps1 b/Evergreen/Shared/Get-GitHubRepoRelease.ps1 index 56a73aa6..46505480 100644 --- a/Evergreen/Shared/Get-GitHubRepoRelease.ps1 +++ b/Evergreen/Shared/Get-GitHubRepoRelease.ps1 @@ -194,6 +194,7 @@ function Get-GitHubRepoRelease { Size = $asset.size URI = $asset.browser_download_url } + Write-Verbose -Message "$($MyInvocation.MyCommand): Matching platform 'Windows' against: $($PSObject.Platform)." if ($PSObject.Platform -eq "Windows") { Write-Output -InputObject $PSObject }