Skip to content

Commit

Permalink
Merge pull request #553 from aaronparker/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
aaronparker authored Sep 29, 2023
2 parents 48df6bc + 1521733 commit 4693fd5
Show file tree
Hide file tree
Showing 61 changed files with 941 additions and 617 deletions.
12 changes: 9 additions & 3 deletions Evergreen/Apps/Get-GhislerTotalCommander.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ function Get-GhislerTotalCommander {
if ($null -ne $Response) {

try {
$Value = ([RegEx]$res.Get.Update.MatchVersion).Match($Response).Groups.Value
$Version = $Value.Split(".")[1,2] -join "."
$VersionString = $Value.Split(".")[1,2] -join ""
$Value = ([Regex]$res.Get.Update.MatchVersion).Match($Response).Groups.Value
$Major = $Value.Split(".")[1]
$Minor = $Value.Split(".")[2]
if ([System.Int16]$Minor -le 9) {
$Minor = "0$Minor"
}
$Version = "$Major.$Minor"
$VersionString = "$Major$Minor"
}
catch {
Write-Warning -Message "$($MyInvocation.MyCommand): Failed to find version number."
$Version = "Unknown"
$VersionString = "Unknown"
}
Expand Down
17 changes: 9 additions & 8 deletions Evergreen/Apps/Get-GitForWindows.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-GitForWindows {
function Get-GitForWindows {
<#
.SYNOPSIS
Returns the available Git for Windows versions.
Expand All @@ -8,20 +8,21 @@ Function Get-GitForWindows {
Twitter: @xenappblog
#>
[OutputType([System.Management.Automation.PSObject])]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification="Product name is a plural")]
[CmdletBinding(SupportsShouldProcess = $False)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "Product name is a plural")]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Uri
MatchVersion = $res.Get.MatchVersion
Filter = $res.Get.MatchFileTypes
Uri = $res.Get.Uri
MatchVersion = $res.Get.MatchVersion
VersionReplace = $res.Get.VersionReplace
Filter = $res.Get.MatchFileTypes
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object
Expand Down
45 changes: 14 additions & 31 deletions Evergreen/Apps/Get-GoogleChrome.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function Get-GoogleChrome {
}
Write-Output -InputObject $PSObject

if ($Channel -eq "stable") {
if ($Channel -eq $res.Get.Download.BundleFilter) {
# Output the version and URI for the bundle download
$PSObject = [PSCustomObject] @{
Version = $Version
Architecture = Get-Architecture -String $res.Get.Download.Bundle
Expand All @@ -44,35 +45,17 @@ function Get-GoogleChrome {
}
Write-Output -InputObject $PSObject
}
}

# Read the JSON and convert to a PowerShell object. Return the current release version of Chrome
# $UpdateFeed = Invoke-RestMethodWrapper -Uri $res.Get.Update.Uri

# # Read the JSON and build an array of platform, channel, version
# foreach ($channel in $res.Get.Download.Uri.GetEnumerator()) {
# Write-Verbose -Message "$($MyInvocation.MyCommand): Channel: $($channel.Name)."

# # Step through each platform property
# foreach ($platform in $res.Get.Download.Platforms) {
# Write-Verbose -Message "$($MyInvocation.MyCommand): Platform: $platform."

# # Filter the feed for the specific channel and platform
# $UpdateItem = $UpdateFeed.versions | Where-Object { ($_.channel -eq $channel.Name) -and ($_.os -eq $platform) }
# foreach ($item in $UpdateItem) {

# # Output the version and URI object
# Write-Verbose -Message "$($MyInvocation.MyCommand): Found $($item.Count) item/s for $($channel.Name), $platform."
# $PSObject = [PSCustomObject] @{
# Version = $item.Version
# Architecture = Get-Architecture -String $item.Os
# Channel = $item.Channel
# Date = ConvertTo-DateTime -DateTime $item.Current_RelDate.Trim() -Pattern $res.Get.Download.DatePattern
# Type = [System.IO.Path]::GetExtension($($res.Get.Download.Uri[$channel.Key].($Platform))).Split(".")[-1]
# URI = $($res.Get.Download.Uri[$channel.Key].($Platform))
# }
# Write-Output -InputObject $PSObject
# }
# }
# }
if ($Channel -match $res.Get.Download.'32bitFilter') {
# Output the version and URI object for the 32-bit version
$PSObject = [PSCustomObject] @{
Version = $Version
Architecture = Get-Architecture -String $($res.Get.Download.Uri.$Channel -replace "64", "")
Channel = $Channel
Type = Get-FileType -File $res.Get.Download.Uri.$Channel
URI = $res.Get.Download.Uri.$Channel -replace "64", ""
}
Write-Output -InputObject $PSObject
}
}
}
31 changes: 6 additions & 25 deletions Evergreen/Apps/Get-HashicorpBoundary.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-HashicorpBoundary {
function Get-HashicorpBoundary {
<#
.SYNOPSIS
Get the current versions and download URLs for Hashicorp Boundary.
Expand All @@ -8,34 +8,15 @@ Function Get-HashicorpBoundary {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Update.Uri
MatchVersion = $res.Get.Update.MatchVersion
Filter = $res.Get.Update.MatchFileTypes
ReturnVersionOnly = $True
}
$object = Get-GitHubRepoRelease @params

# Build the output object
If ($Null -ne $object) {
ForEach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceText, $object.Version
$PSObject = [PSCustomObject] @{
Version = $object.Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $Uri
}
Write-Output -InputObject $PSObject
}
}
$Output = Get-HashicorpApp -res $res
Write-Output -InputObject $Output
}
31 changes: 6 additions & 25 deletions Evergreen/Apps/Get-HashicorpConsul.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-HashicorpConsul {
function Get-HashicorpConsul {
<#
.SYNOPSIS
Get the current versions and download URLs for Hashicorp Consul.
Expand All @@ -8,34 +8,15 @@ Function Get-HashicorpConsul {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Update.Uri
MatchVersion = $res.Get.Update.MatchVersion
Filter = $res.Get.Update.MatchFileTypes
ReturnVersionOnly = $True
}
$object = Get-GitHubRepoRelease @params

# Build the output object
If ($Null -ne $object) {
ForEach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceText, $object.Version
$PSObject = [PSCustomObject] @{
Version = $object.Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $Uri
}
Write-Output -InputObject $PSObject
}
}
$Output = Get-HashicorpApp -res $res
Write-Output -InputObject $Output
}
31 changes: 6 additions & 25 deletions Evergreen/Apps/Get-HashicorpNomad.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-HashicorpNomad {
function Get-HashicorpNomad {
<#
.SYNOPSIS
Get the current versions and download URLs for Hashicorp Nomad.
Expand All @@ -8,34 +8,15 @@ Function Get-HashicorpNomad {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Update.Uri
MatchVersion = $res.Get.Update.MatchVersion
Filter = $res.Get.Update.MatchFileTypes
ReturnVersionOnly = $True
}
$object = Get-GitHubRepoRelease @params

# Build the output object
If ($Null -ne $object) {
ForEach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceText, $object.Version
$PSObject = [PSCustomObject] @{
Version = $object.Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $Uri
}
Write-Output -InputObject $PSObject
}
}
$Output = Get-HashicorpApp -res $res
Write-Output -InputObject $Output
}
31 changes: 6 additions & 25 deletions Evergreen/Apps/Get-HashicorpPacker.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-HashicorpPacker {
function Get-HashicorpPacker {
<#
.SYNOPSIS
Get the current versions and download URLs for Hashicorp Packer.
Expand All @@ -8,34 +8,15 @@ Function Get-HashicorpPacker {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Update.Uri
MatchVersion = $res.Get.Update.MatchVersion
Filter = $res.Get.Update.MatchFileTypes
ReturnVersionOnly = $True
}
$object = Get-GitHubRepoRelease @params

# Build the output object
If ($Null -ne $object) {
ForEach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceText, $object.Version
$PSObject = [PSCustomObject] @{
Version = $object.Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $Uri
}
Write-Output -InputObject $PSObject
}
}
$Output = Get-HashicorpApp -res $res
Write-Output -InputObject $Output
}
31 changes: 6 additions & 25 deletions Evergreen/Apps/Get-HashicorpTerraform.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-HashicorpTerraform {
function Get-HashicorpTerraform {
<#
.SYNOPSIS
Get the current versions and download URLs for Hashicorp Terraform.
Expand All @@ -8,34 +8,15 @@ Function Get-HashicorpTerraform {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Update.Uri
MatchVersion = $res.Get.Update.MatchVersion
Filter = $res.Get.Update.MatchFileTypes
ReturnVersionOnly = $True
}
$object = Get-GitHubRepoRelease @params

# Build the output object
If ($Null -ne $object) {
ForEach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceText, $object.Version
$PSObject = [PSCustomObject] @{
Version = $object.Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $Uri
}
Write-Output -InputObject $PSObject
}
}
$Output = Get-HashicorpApp -res $res
Write-Output -InputObject $Output
}
31 changes: 6 additions & 25 deletions Evergreen/Apps/Get-HashicorpVault.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Function Get-HashicorpVault {
function Get-HashicorpVault {
<#
.SYNOPSIS
Get the current versions and download URLs for Hashicorp Vault.
Expand All @@ -8,34 +8,15 @@ Function Get-HashicorpVault {
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $False)]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $False, Position = 0)]
[ValidateNotNull()]
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Pass the repo releases API URL and return a formatted object
$params = @{
Uri = $res.Get.Update.Uri
MatchVersion = $res.Get.Update.MatchVersion
Filter = $res.Get.Update.MatchFileTypes
ReturnVersionOnly = $True
}
$object = Get-GitHubRepoRelease @params

# Build the output object
If ($Null -ne $object) {
ForEach ($Architecture in $res.Get.Download.Uri.GetEnumerator()) {
$Uri = $res.Get.Download.Uri[$Architecture.Key] -replace $res.Get.Download.ReplaceText, $object.Version
$PSObject = [PSCustomObject] @{
Version = $object.Version
Type = Get-FileType -File $Uri
Architecture = $Architecture.Name
URI = $Uri
}
Write-Output -InputObject $PSObject
}
}
$Output = Get-HashicorpApp -res $res
Write-Output -InputObject $Output
}
Loading

0 comments on commit 4693fd5

Please sign in to comment.