Apps/Get-GhislerTotalCommander.ps1
Function Get-GhislerTotalCommander { <# .SYNOPSIS Returns the available Ghisler TotalCommander versions. .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 $params = @{ Name = $res.Get.Update.Uri Type = $res.Get.Update.DnsType } $Response = Resolve-DnsNameWrapper @params if ($Null -ne $Response) { try { $Version = ([RegEx]$res.Get.Update.MatchVersion).Match($Response).Groups.Value $VersionString = $Version.ToString() -replace "\.", "" } catch { $Version = "Unknown" } foreach ($item in $res.Get.Download.Uri.GetEnumerator()) { $PSObject = [PSCustomObject] @{ Version = $Version Architecture = $item.Name URI = $res.Get.Download.Uri[$item.Key] -replace $res.Get.Download.ReplaceText, $VersionString } Write-Output -InputObject $PSObject } } } |