Merge branch 'main' into lg/postgres-win-update

This commit is contained in:
lawrencegripper
2024-12-20 14:55:28 +00:00
54 changed files with 2225 additions and 726 deletions

View File

@@ -321,6 +321,22 @@ function Get-TCToolVersionPath {
return Join-Path $foundVersion $Arch
}
function Test-IsWin25 {
<#
.SYNOPSIS
Checks if the current Windows operating system is Windows Server 2025.
.DESCRIPTION
This function uses the Get-CimInstance cmdlet to retrieve information
about the current Windows operating system. It then checks if the Caption
property of the Win32_OperatingSystem class contains the string "2025",
indicating that the operating system is Windows Server 2025.
.OUTPUTS
Returns $true if the current Windows operating system is Windows Server 2025.
Otherwise, returns $false.
#>
(Get-CimInstance -ClassName Win32_OperatingSystem).Caption -match "2025"
}
function Test-IsWin22 {
<#
.SYNOPSIS
@@ -603,8 +619,17 @@ function Get-GithubReleasesByVersion {
)
}
# Sort releases by version
$releases = $releases | Sort-Object -Descending { [version] $_.version }
# Sort releases by version, then by tag name parts if version is the same
$releases = $releases | Sort-Object -Descending {
[version] $_.version
}, {
$cleanTagName = $_.tag_name -replace '^v', ''
$parts = $cleanTagName -split '[.\-]'
$parsedParts = $parts | ForEach-Object {
if ($_ -match '^\d+$') { [int]$_ } else { $_ }
}
$parsedParts
}
# Select releases matching version
if ($Version -eq "latest") {