28 lines
724 B
PowerShell
28 lines
724 B
PowerShell
[CmdletBinding()]param(
|
|
[string[]]$Instance, [string[]]$Application, [string[]]$Runtime
|
|
)
|
|
|
|
$local:cols = [ordered]@{
|
|
'instance'= 'Instance'
|
|
'pid'= 'PID'
|
|
'application'= 'Application'
|
|
'runtime' = 'Runtime'
|
|
}
|
|
|
|
$local:paks = @(
|
|
$($cols.Values -join "`t")) + $(
|
|
flatpak ps "--columns=$($cols.Keys -join ',')"
|
|
) -join "`n" |
|
|
ConvertFrom-Csv -Delimiter "`t" |
|
|
Where-Object {
|
|
$local:p = $_
|
|
(-not $Instance -or $( $_ -in $Instance )
|
|
) -and (-not $Application -or $(
|
|
$Application | Where-Object { $($p.Application) -match $_ }
|
|
)) -and (-not $Runtime -or $(
|
|
$Runtime | Where-Object { $($p.Runtime) -match $_ }
|
|
))
|
|
}
|
|
|
|
$paks
|