Files
Scoop/libexec/scoop-list.ps1
T
2017-02-13 20:20:41 +11:00

35 lines
925 B
PowerShell

# Usage: scoop list [query]
# Summary: List installed apps
# Help: Lists all installed apps, or the apps matching the supplied query.
param($query)
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\versions.ps1"
. "$psscriptroot\..\lib\manifest.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
reset_aliases
$local = installed_apps $false | % { @{ name = $_ } }
$global = installed_apps $true | % { @{ name = $_; global = $true } }
$apps = @($local) + @($global)
if($apps) {
echo "Installed apps$(if($query) { `" matching '$query'`"}):
"
$apps | sort { $_.name } | ? { !$query -or ($_.name -match $query) } | % {
$app = $_.name
$global = $_.global
$ver = current_version $app $global
$global_display = $null; if($global) { $global_display = '*global*'}
" $app ($ver) $global_display"
}
""
exit 0
} else {
"There aren't any apps installed."
exit 1
}