From 66dfa984d0b712ef80432bbd25d4fa527471a1b8 Mon Sep 17 00:00:00 2001 From: Aaron Parker Date: Sun, 7 Jul 2024 19:43:54 +1000 Subject: [PATCH] Add ManicTimeClient #572 --- Evergreen/Apps/Get-ManicTimeClient.ps1 | 28 ++++++++++++++++++++++++ Evergreen/Manifests/ManicTimeClient.json | 24 ++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Evergreen/Apps/Get-ManicTimeClient.ps1 create mode 100644 Evergreen/Manifests/ManicTimeClient.json diff --git a/Evergreen/Apps/Get-ManicTimeClient.ps1 b/Evergreen/Apps/Get-ManicTimeClient.ps1 new file mode 100644 index 00000000..5750f5c2 --- /dev/null +++ b/Evergreen/Apps/Get-ManicTimeClient.ps1 @@ -0,0 +1,28 @@ +function Get-ManicTimeClient { + <# + .NOTES + Site: https://stealthpuppy.com + 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]) + ) + + $UpdateFeed = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri + if ($null -ne $UpdateFeed) { + # Build the output object; Output object to the pipeline + $PSObject = [PSCustomObject] @{ + Version = $UpdateFeed.version + Date = $UpdateFeed.releaseDate + Type = Get-FileType -File $UpdateFeed.downloadUrl + URI = $UpdateFeed.downloadUrl + } + Write-Output -InputObject $PSObject + } +} diff --git a/Evergreen/Manifests/ManicTimeClient.json b/Evergreen/Manifests/ManicTimeClient.json new file mode 100644 index 00000000..3707967c --- /dev/null +++ b/Evergreen/Manifests/ManicTimeClient.json @@ -0,0 +1,24 @@ +{ + "Name": "ManicTime", + "Source": "https://www.manictime.com/download/windows", + "Get": { + "Update": { + "Uri": "https://services.manictime.com/Versions/GetLatestVersionNumber?currentVersion=2024.1.1.0&runtime=win-x64&targetRuntime=win-x64&operatingSystemVersion=10.0.22621.0&platform=X64&systemCulture=en-US&includeMessage=False" + } + }, + "Install": { + "Setup": "AppName.*.exe", + "Physical": { + "Arguments": "", + "PostInstall": [ + + ] + }, + "Virtual": { + "Arguments": "", + "PostInstall": [ + + ] + } + } +}