Improve list-installed-apps.ps1

This commit is contained in:
Markus Fleschutz
2021-09-27 07:13:53 +02:00
parent 9748042e05
commit b1a8a339be

View File

@ -2,7 +2,7 @@
.SYNOPSIS .SYNOPSIS
list-installed-apps.ps1 list-installed-apps.ps1
.DESCRIPTION .DESCRIPTION
Lists the installed Windows Store apps Lists the installed apps (from Windows Store or snaps)
.EXAMPLE .EXAMPLE
PS> ./list-installed-apps PS> ./list-installed-apps
.NOTES .NOTES
@ -12,7 +12,11 @@
#> #>
try { try {
get-appxPackage | select-object Name,Version | format-table -autoSize if ($IsLinux) {
& snap list
} else {
get-appxPackage | select-object Name,Version | format-table -autoSize
}
exit 0 exit 0
} catch { } catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"