diff --git a/.vscode/settings.json b/.vscode/settings.json index e60a0dc..5cea1cf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ + "isnot", "Nieto" ] } \ No newline at end of file diff --git a/SignSettings.psd1 b/SignSettings.psd1 index 2504e5b..dcd8184 100644 --- a/SignSettings.psd1 +++ b/SignSettings.psd1 @@ -1,5 +1,5 @@ @{ - FilePath = @('Scoop.psd1', 'Scoop.psm1') + FilePath = @('Scoop.psd1', 'Scoop.psm1', 'Scoop.format.ps1xml') TimeStampServer = 'http://timestamp.sectigo.com' HashAlgorithm = 'SHA256' } diff --git a/src/Scoop.format.ps1xml b/src/Scoop.format.ps1xml new file mode 100644 index 0000000..857001d --- /dev/null +++ b/src/Scoop.format.ps1xml @@ -0,0 +1,71 @@ + + + + Default + + ScoopAppDetailed + Deserialized.ScoopAppDetailed + + + + + 20 + + + 10 + + + 10 + + + + + + + + + Name + + + Version + + + Source + + + Description + + + + + + + + Default + + ScoopAppDetailed + Deserialized.ScoopAppDetailed + + + + + + + Name + + + Version + + + Source + + + Description + + + + + + + + diff --git a/src/Scoop.psd1 b/src/Scoop.psd1 index 70b7244..4a1ce62 100644 --- a/src/Scoop.psd1 +++ b/src/Scoop.psd1 @@ -1,6 +1,6 @@ @{ RootModule = 'Scoop.psm1' - ModuleVersion = '0.1.3' + ModuleVersion = '0.2.0' CompatiblePSEditions = @('Desktop', 'Core') GUID = '7603664e-144c-4083-a51d-399df057a37d' Author = 'Thomas Nieto' @@ -12,7 +12,8 @@ 'Register-ScoopBucket', 'Unregister-ScoopBucket') CmdletsToExport = @() AliasesToExport = @() - FileList = @('Scoop.psd1', 'Scoop.psm1') + FormatsToProcess = @('Scoop.format.ps1xml') + FileList = @('Scoop.psd1', 'Scoop.psm1', 'Scoop.format.ps1xml') PrivateData = @{ PSData = @{ Tags = @('Scoop', 'Windows') diff --git a/src/Scoop.psm1 b/src/Scoop.psm1 index 81e5e75..b6f6f5c 100644 --- a/src/Scoop.psm1 +++ b/src/Scoop.psm1 @@ -7,6 +7,8 @@ class ScoopAppDetailed { [string] $Version [string] $Source [string] $Description + [string] $Homepage + [string[]] $Binaries } <# @@ -24,6 +26,7 @@ class ScoopAppDetailed { #> function Find-ScoopApp { [CmdletBinding()] + [OutputType([ScoopAppDetailed])] param ( [Parameter(Position = 0, ValueFromPipeline, @@ -58,11 +61,21 @@ function Find-ScoopApp { ForEach-Object { $value = $_ | Get-Content | ConvertFrom-Json + $binaries = if ($value.Bin) { + $value.Bin | + Where-Object { $_ -isnot [object[]] } | + Split-Path -Leaf + } else { + $null + } + [ScoopAppDetailed]@{ Name = $_.BaseName Version = $value.Version Source = ($_.Directory | Split-Path -Parent | Split-Path -Leaf) Description = $value.Description + Binaries = $binaries + Homepage = $value.Homepage } } }