Skip to content

Commit

Permalink
Merge pull request #688 from aaronparker/apps
Browse files Browse the repository at this point in the history
Apps
  • Loading branch information
aaronparker authored May 21, 2024
2 parents 207c926 + 337ca91 commit 5fa0bc3
Show file tree
Hide file tree
Showing 33 changed files with 469 additions and 52 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions Evergreen/Apps/Get-AdoptiumTemurin21.ps1
Original file line number Diff line number Diff line change
@@ -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
}
18 changes: 18 additions & 0 deletions Evergreen/Apps/Get-AzulZulu21.ps1
Original file line number Diff line number Diff line change
@@ -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
}
22 changes: 10 additions & 12 deletions Evergreen/Apps/Get-FileZilla.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,30 @@ 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])
)

# 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) {
Expand Down
15 changes: 13 additions & 2 deletions Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ function Get-MicrosoftODBCDriverForSQLServer {
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

$Output = Get-MicrosoftFwLink -res $res
Write-Output -InputObject $Output
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
}
}
}
28 changes: 28 additions & 0 deletions Evergreen/Apps/Get-MicrosoftODBCDriverForSQLServer17.ps1
Original file line number Diff line number Diff line change
@@ -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
}
}
}
15 changes: 13 additions & 2 deletions Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ function Get-MicrosoftOLEDBDriverForSQLServer {
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

$Output = Get-MicrosoftFwLink -res $res
Write-Output -InputObject $Output
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
}
}
}
28 changes: 28 additions & 0 deletions Evergreen/Apps/Get-MicrosoftOLEDBDriverForSQLServer18.ps1
Original file line number Diff line number Diff line change
@@ -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
}
}
}
18 changes: 18 additions & 0 deletions Evergreen/Apps/Get-MicrosoftOpenJDK21.ps1
Original file line number Diff line number Diff line change
@@ -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
}
27 changes: 10 additions & 17 deletions Evergreen/Apps/Get-MicrosoftSsms.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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
}
Expand Down
37 changes: 37 additions & 0 deletions Evergreen/Apps/Get-Proxyman.ps1
Original file line number Diff line number Diff line change
@@ -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
}
18 changes: 18 additions & 0 deletions Evergreen/Apps/Get-RedHatOpenJDK21.ps1
Original file line number Diff line number Diff line change
@@ -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
}
22 changes: 22 additions & 0 deletions Evergreen/Manifests/AdoptiumTemurin21.json
Original file line number Diff line number Diff line change
@@ -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": []
}
}
}
23 changes: 23 additions & 0 deletions Evergreen/Manifests/AzulZulu21.json
Original file line number Diff line number Diff line change
@@ -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": []
}
}
}
21 changes: 17 additions & 4 deletions Evergreen/Manifests/MicrosoftODBCDriverForSQLServer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
{
"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": {
"Uri": ""
},
"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"
],
"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"
}
Expand Down
Loading

0 comments on commit 5fa0bc3

Please sign in to comment.