Skip to content

Commit

Permalink
Add Proxyman
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronparker committed May 21, 2024
1 parent ddae317 commit 337ca91
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
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
}
26 changes: 26 additions & 0 deletions Evergreen/Manifests/Proxyman.json
Original file line number Diff line number Diff line change
@@ -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": []
}
}
}
1 change: 1 addition & 0 deletions Evergreen/Shared/Get-GitHubRepoRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 337ca91

Please sign in to comment.