Skip to content

Commit

Permalink
Merge pull request #703 from aaronparker/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
aaronparker authored Jun 15, 2024
2 parents 020b1ec + e5a5c73 commit ec8a0cc
Show file tree
Hide file tree
Showing 22 changed files with 483 additions and 407 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Evergreen/Apps/Get-GitHubRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Get-GitHubRelease {

[Parameter(Mandatory = $False, Position = 1)]
[ValidateScript( {
if ($_ -match "^(https://api\.github\.com/repos/)([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)(/releases/latest)$") {
if ($_ -match "^(https://api\.github\.com/repos/)([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)(/releases)$") {
$True
}
else {
Expand Down
7 changes: 6 additions & 1 deletion Evergreen/Apps/Get-PDFArranger.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ Function Get-PDFArranger {
Filter = $res.Get.MatchFileTypes
}
$object = Get-GitHubRepoRelease @params
Write-Output -InputObject $object

# Filter the object to return the latest version with assets
Write-Verbose -Message "$($MyInvocation.MyCommand): Returned $($object.Count) releases"
$Latest = $object | Select-Object -First 1
Write-Verbose -Message "$($MyInvocation.MyCommand): Filter objects for latest version: $($Latest.Version)"
$object | Where-Object { $Latest.Version -eq $_.Version } | Write-Output
}
30 changes: 30 additions & 0 deletions Evergreen/Apps/Get-QGIS.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function Get-QGIS {
<#
.NOTES
Author: Aaron Parker
Twitter: @stealthpuppy
#>
[OutputType([System.Management.Automation.PSObject])]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification="Product name ends in s")]
[CmdletBinding(SupportsShouldProcess = $false)]
param (
[Parameter(Mandatory = $false, Position = 0)]
[ValidateNotNull()]
[System.Management.Automation.PSObject]
$res = (Get-FunctionResource -AppName ("$($MyInvocation.MyCommand)".Split("-"))[1])
)

# Get the update feed
$UpdateFeed = Invoke-EvergreenRestMethod -Uri $res.Get.Update.Uri

# Return an object for each channel
foreach ($Channel in $res.Get.Update.Channels) {
$Version = "$($UpdateFeed.$Channel.version)-$($UpdateFeed.$Channel.binary)"
[PSCustomObject]@{
Version = $Version
Channel = $Channel
Date = $UpdateFeed.$Channel.date
URI = $res.Get.Download.Uri -replace $res.Get.Download.ReplaceText, $Version
} | Write-Output
}
}
1 change: 1 addition & 0 deletions Evergreen/Apps/Get-SAGAGIS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Function Get-SAGAGIS {
Twitter: @adotcoop
#>
[OutputType([System.Management.Automation.PSObject])]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification="Product name is a plural")]
[CmdletBinding(SupportsShouldProcess = $False)]
param (
[Parameter(Mandatory = $False, Position = 0)]
Expand Down
11 changes: 3 additions & 8 deletions Evergreen/Evergreen.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Evergreen.psm1'

# Version number of this module.
ModuleVersion = '2405.1076'
ModuleVersion = '2405.1077'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -69,11 +69,7 @@ PowerShellVersion = '3.0'
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @('Export-EvergreenApp', 'Export-EvergreenManifest',
'Find-EvergreenApp', 'Get-EvergreenApp', 'Get-EvergreenEndpoint',
'Get-EvergreenLibrary', 'Get-EvergreenLibraryApp',
'Invoke-EvergreenApp', 'Invoke-EvergreenLibraryUpdate',
'New-EvergreenLibrary', 'Save-EvergreenApp', 'Test-EvergreenApp')
FunctionsToExport = @('Export-EvergreenApp', 'Export-EvergreenManifest', 'Find-EvergreenApp', 'Get-EvergreenApp', 'Get-EvergreenEndpointFromApi','Get-EvergreenLibrary', 'Get-EvergreenLibraryApp', 'Get-EvergreenAppFromApi', 'Start-EvergreenLibraryUpdate', 'New-EvergreenLibrary', 'Save-EvergreenApp', 'Test-EvergreenApp')

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
Expand All @@ -82,8 +78,7 @@ CmdletsToExport = @()
# VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = 'sea', 'gea', 'fea', 'tea', 'iea', 'Get-EvergreenAppFromApi',
'Start-EvergreenLibraryUpdate'
AliasesToExport = @('sea', 'gea', 'fea', 'tea', 'iea', 'Invoke-EvergreenLibraryUpdate', 'Invoke-EvergreenApp', 'Get-EvergreenEndpoint')

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand Down
11 changes: 5 additions & 6 deletions Evergreen/Evergreen.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[CmdletBinding(SupportsShouldProcess = $false)]
param ()

#region Get public and private function definition files
# Get public and private function definition files
$PublicRoot = Join-Path -Path $PSScriptRoot -ChildPath "Public"
$PrivateRoot = Join-Path -Path $PSScriptRoot -ChildPath "Private"
$SharedRoot = Join-Path -Path $PSScriptRoot -ChildPath "Shared"
Expand All @@ -24,16 +24,15 @@ foreach ($Import in @($Public + $Private + $Shared)) {
}
}

# Export the public modules and aliases
Export-ModuleMember -Function $public.Basename -Alias *
#endregion

# Get module strings
$script:resourceStrings = Get-ModuleResource

# Register the argument completer for the Get-EvergreenApp and Find-EvergreenApp cmdlets
$Commands = "Get-EvergreenApp", "Find-EvergreenApp", "Invoke-EvergreenApp", "Export-EvergreenManifest", "Get-EvergreenLibraryApp", "Get-EvergreenEndpoint"
$Commands = "Get-EvergreenApp", "Find-EvergreenApp", "Get-EvergreenAppFromApi", "Export-EvergreenManifest", "Get-EvergreenLibraryApp", "Get-EvergreenEndpointFromApi"
Register-ArgumentCompleter -CommandName $Commands -ParameterName "Name" -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
(Get-ChildItem -Path "$PSScriptRoot\Manifests\$wordToComplete*.json" -ErrorAction "Ignore").BaseName
}

# Export the public modules and aliases
Export-ModuleMember -Function $public.Basename -Alias *
8 changes: 4 additions & 4 deletions Evergreen/Manifests/DevToys.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
"Get": {
"Uri": "https://api.github.com/repos/DevToys-app/DevToys/releases/latest",
"MatchVersion": "(\\d+(\\.\\d+){1,4}).*",
"MatchFileTypes": "\\.exe$|\\.msi$|\\.msixbundle$"
"MatchFileTypes": "\\.exe$|\\.zip$|\\.msixbundle$"
},
"Install": {
"Setup": "Brackets*.msi",
"Setup": "*.exe",
"Preinstall": "",
"Physical": {
"Arguments": "/quiet /norestart",
"Arguments": "/VERYSILENT /NORESTART",
"PostInstall": [
]
},
"Virtual": {
"Arguments": "/quiet /norestart",
"Arguments": "/VERYSILENT /NORESTART",
"PostInstall": [
]
}
Expand Down
2 changes: 1 addition & 1 deletion Evergreen/Manifests/PDFArranger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Name": "PDF Arranger",
"Source": "https://github.com/pdfarranger/pdfarranger/",
"Get": {
"Uri": "https://api.github.com/repos/pdfarranger/pdfarranger/releases/latest",
"Uri": "https://api.github.com/repos/pdfarranger/pdfarranger/releases",
"MatchVersion": "(\\d+(\\.\\d+){1,4}).*",
"MatchFileTypes": "\\.exe$|\\.msi$"
},
Expand Down
29 changes: 29 additions & 0 deletions Evergreen/Manifests/QGIS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Name": "QGIS",
"Source": "https://qgis.org/en/site/index.html",
"Get": {
"Update": {
"Uri": "https://version.qgis.org/version.json",
"Channels": [
"latest",
"ltr"
]
},
"Download": {
"Uri": "https://download.osgeo.org/qgis/windows/QGIS-OSGeo4W-#version.msi",
"ReplaceText": "#version"
}
},
"Install": {
"Setup": "",
"Preinstall": "",
"Physical": {
"Arguments": "/quiet /norestart",
"PostInstall": []
},
"Virtual": {
"Arguments": "/quiet /norestart",
"PostInstall": []
}
}
}
4 changes: 2 additions & 2 deletions Evergreen/Public/Get-EvergreenApp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ function Get-EvergreenApp {
[Alias("gea")]
param (
[Parameter(
Mandatory = $true,
Mandatory = $false,
Position = 0,
ValueFromPipeline,
ValueFromPipelineByPropertyName,
HelpMessage = "Specify an application name. Use Find-EvergreenApp to list supported applications.")]
[ValidateNotNull()]
[Alias("ApplicationName")]
[System.String] $Name,
[System.String] $Name = "Microsoft365Apps",

[Parameter(
Mandatory = $false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function Invoke-EvergreenApp {
function Get-EvergreenAppFromApi {
<#
.EXTERNALHELP Evergreen-help.xml
#>
[OutputType([System.Management.Automation.PSObject])]
[CmdletBinding(SupportsShouldProcess = $false)]
[Alias("iea", "Get-EvergreenAppFromApi")]
[Alias("iea", "Invoke-EvergreenApp")]
param (
[Parameter(
Mandatory = $false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
function Get-EvergreenEndpoint {
function Get-EvergreenEndpointFromApi {
<#
.EXTERNALHELP Evergreen-help.xml
#>
[CmdletBinding(SupportsShouldProcess = $false)]
[Alias("Get-EvergreenEndpoint")]
param (
[Parameter(
Position = 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function Invoke-EvergreenLibraryUpdate {
function Start-EvergreenLibraryUpdate {
<#
.EXTERNALHELP Evergreen-help.xml
#>
[CmdletBinding(SupportsShouldProcess = $true)]
[Alias("Start-EvergreenLibraryUpdate")]
[Alias("Invoke-EvergreenLibraryUpdate")]
param (
[Parameter(
Mandatory = $true,
Expand Down
Loading

0 comments on commit ec8a0cc

Please sign in to comment.