Update list-cli-tools.ps1

This commit is contained in:
Markus Fleschutz 2022-11-21 21:42:41 +01:00
parent 26c750bd05
commit 32bd7c2edf

View File

@ -1,8 +1,8 @@
<#
.SYNOPSIS
Lists installed CLI tools
Lists installed command-line tools
.DESCRIPTION
This PowerShell script lists installed command-line interface (CLI) tools.
This PowerShell script lists all installed command-line tools (name/version/path/file size, sorted by name).
.EXAMPLE
PS> ./list-cli-tools
@ -16,13 +16,13 @@
Author: Markus Fleschutz | License: CC0
#>
function CheckFor { param([string]$Cmd, [string]$VersionArg)
function TryCmd { param([string]$Cmd, [string]$VersionArg)
try {
$Info = Get-Command $Cmd -ErrorAction Stop
$Path = $Info.Source
if ("$($Info.Version)" -eq "0.0.0.0") {
if ("$VersionArg" -ne "") {
$Result = invoke-expression "$Path $VersionArg"
$Result = Invoke-Expression "$Path $VersionArg"
if ("$Result" -match '\d+.\d+\.\d+') {
$Version = "$($Matches[0])"
} elseif ("$Result" -match '\d+\.\d+') {
@ -47,238 +47,238 @@ function CheckFor { param([string]$Cmd, [string]$VersionArg)
}
}
function ListTools {
CheckFor 7z "-version"
CheckFor ant "-v"
CheckFor apt "--version"
CheckFor apt-get "--version"
CheckFor amixer "--version"
CheckFor aplay "--version"
CheckFor ar "--version"
CheckFor arch "--version"
CheckFor arecord "--version"
CheckFor arp ""
CheckFor at ""
CheckFor attrib ""
CheckFor awk "--version"
CheckFor b2sum "--version"
CheckFor base32 "--version"
CheckFor base64 "--version"
CheckFor basename "--version"
CheckFor basenc "--version"
CheckFor bash "--version"
CheckFor bc "--version"
CheckFor bunzip2 "--version"
CheckFor bzcat "--version"
CheckFor bzip2 "--version"
CheckFor bzip2recover "--version"
CheckFor captoinfo "--version"
CheckFor cat "-version"
CheckFor cc "--version"
CheckFor chattr "--version"
CheckFor chcon "--version"
CheckFor chdsk ""
CheckFor chgrp "--version"
CheckFor chmod "--version"
CheckFor chkntfs ""
CheckFor chown "--version"
CheckFor chroot "--version"
CheckFor choco "--version"
CheckFor cipher ""
CheckFor cksum "--version"
CheckFor clang "--version"
CheckFor clear "--version"
CheckFor cmake "--version"
CheckFor cmd ""
CheckFor cmp "--version"
CheckFor column "--version"
CheckFor comp ""
CheckFor compact ""
CheckFor cp "--version"
CheckFor cpack "--version"
CheckFor csplit "--version"
CheckFor ctest "--version"
CheckFor curl "--version"
CheckFor cut "--version"
CheckFor cygcheck "--version"
CheckFor cygpath "--version"
CheckFor d2u "--version"
CheckFor dash "--version"
CheckFor date ""
CheckFor dd "--version"
CheckFor df "--version"
CheckFor diff "--version"
CheckFor diff3 "--version"
CheckFor dir "--version"
CheckFor dircolors "--version"
CheckFor dirname "--version"
CheckFor dism ""
CheckFor dos2unix "--version"
CheckFor driverquery ""
CheckFor du "--version"
CheckFor echo "--version"
CheckFor egrep "--version"
CheckFor env "--version"
CheckFor ex "--version"
CheckFor expand "--version"
CheckFor expr "--version"
CheckFor factor "--version"
CheckFor false "--version"
CheckFor fido2-assert "--version"
CheckFor fido2-cred "--version"
CheckFor fido2-token "--version"
CheckFor file "--version"
CheckFor find "--version"
CheckFor fgrep "--version"
CheckFor fmt "--version"
CheckFor fold "--version"
CheckFor ftp "--version"
CheckFor funzip "--version"
CheckFor gawk "--version"
CheckFor gencat "--version"
CheckFor getconf "--version"
CheckFor getopt "--version"
CheckFor gettext "--version"
CheckFor gcc "--version"
CheckFor gdb "--version"
CheckFor gh "--version"
CheckFor git "--version"
CheckFor gkill "--version"
CheckFor gmondump "--version"
CheckFor gpg "--version"
CheckFor gpg-agent "--version"
CheckFor gpgconf "--version"
CheckFor gpg-error "--version"
CheckFor gpgsplit "--version"
CheckFor gpgtar "--version"
CheckFor grep "--version"
CheckFor groups "--version"
CheckFor gzip "--version"
CheckFor head "--version"
CheckFor hcsdiag ""
CheckFor help "--version"
CheckFor hmac256 "--version"
CheckFor hostid "--version"
CheckFor hostname ""
CheckFor htop "--version"
CheckFor iconv "--version"
CheckFor id "--version"
CheckFor ipfs "--version"
CheckFor java "--version"
CheckFor join "--version"
CheckFor kill "--version"
CheckFor ldd "--version"
CheckFor less "--version"
CheckFor link "--version"
CheckFor ln "--version"
CheckFor locale "--version"
CheckFor locate "--version"
CheckFor logname "--version"
CheckFor ls "--version"
CheckFor lsattr "--version"
CheckFor lsb_release ""
CheckFor lzma "--version"
CheckFor mac2unix "--version"
CheckFor make "--version"
CheckFor md5sum "--version"
CheckFor minidumper "--version"
CheckFor mkdir "--version"
CheckFor mkfifo "--version"
CheckFor mkgroup "--version"
CheckFor mknod "--version"
CheckFor mkpasswd "--version"
CheckFor mktemp "--version"
CheckFor mount "--version"
CheckFor MpCmdRun "-h"
CheckFor netsh ""
CheckFor netstat ""
CheckFor nice "--version"
CheckFor nohup "--version"
CheckFor nroff "--version"
CheckFor nslookup ""
CheckFor openssl ""
CheckFor passwd "--version"
CheckFor paste "--version"
CheckFor perl "--version"
CheckFor ping "-V"
CheckFor ping6 "-V"
CheckFor pip "--version"
CheckFor pip3 "--version"
CheckFor pip3.8 "--version"
CheckFor powercfg "/?"
CheckFor powershell "--version"
CheckFor print ""
CheckFor printf "--version"
CheckFor python "--version"
CheckFor python3 "--version"
CheckFor python3.8 "--version"
CheckFor rasdial "--version"
CheckFor regedit "--version"
CheckFor replace "--version"
CheckFor robocopy "--version"
CheckFor route ""
CheckFor rsh ""
CheckFor rsync "--version"
CheckFor rundll32 "--version"
CheckFor scp ""
CheckFor sftp ""
CheckFor sh "--version"
CheckFor sha1sum "--version"
CheckFor sha256sum "--version"
CheckFor sha512sum "--version"
CheckFor ssh ""
CheckFor ssh-keygen ""
CheckFor sort "--version"
CheckFor split "--version"
CheckFor strace "--version"
CheckFor strings "--version"
CheckFor strip "--version"
CheckFor sudo "--version"
CheckFor systeminfo ""
CheckFor tail "--version"
CheckFor tar "--version"
CheckFor taskkill ""
CheckFor tasklist ""
CheckFor tee "--version"
CheckFor time ""
CheckFor timeout ""
CheckFor top "-v"
CheckFor tskill ""
CheckFor typeperf ""
CheckFor tzsync "--version"
CheckFor uniq "--version"
CheckFor vi "--version"
CheckFor vim "--version"
CheckFor vulkaninfo "--version"
CheckFor w32tm "/?"
CheckFor waitfor "--version"
CheckFor wakeonlan ""
CheckFor wget "--version"
CheckFor where "--version"
CheckFor whatis "--version"
CheckFor which ""
CheckFor winget "--version"
CheckFor winsat ""
CheckFor whoami "--version"
CheckFor wput "--version"
CheckFor write ""
CheckFor wsl "--version"
CheckFor xcopy "--version"
CheckFor yes "--version"
CheckFor zip "--version"
CheckFor zipcloak "--version"
CheckFor zipdetails ""
CheckFor zipgrep ""
CheckFor zipinfo ""
CheckFor zipnote ""
CheckFor zipsplit ""
CheckFor zsh "--version"
function ListCmdTools {
TryCmd 7z "-version"
TryCmd ant "-v"
TryCmd apt "--version"
TryCmd apt-get "--version"
TryCmd amixer "--version"
TryCmd aplay "--version"
TryCmd ar "--version"
TryCmd arch "--version"
TryCmd arecord "--version"
TryCmd arp ""
TryCmd at ""
TryCmd attrib ""
TryCmd awk "--version"
TryCmd b2sum "--version"
TryCmd base32 "--version"
TryCmd base64 "--version"
TryCmd basename "--version"
TryCmd basenc "--version"
TryCmd bash "--version"
TryCmd bc "--version"
TryCmd bunzip2 "--version"
TryCmd bzcat "--version"
TryCmd bzip2 "--version"
TryCmd bzip2recover "--version"
TryCmd captoinfo "-V"
TryCmd cat "-version"
TryCmd cc "--version"
TryCmd chattr "--version"
TryCmd chcon "--version"
TryCmd chdsk ""
TryCmd chgrp "--version"
TryCmd chmod "--version"
TryCmd chkntfs ""
TryCmd chown "--version"
TryCmd chroot "--version"
TryCmd choco "--version"
TryCmd cipher ""
TryCmd cksum "--version"
TryCmd clang "--version"
TryCmd clear "-V"
TryCmd cmake "--version"
TryCmd cmd ""
TryCmd cmp "--version"
TryCmd column "--version"
TryCmd comp ""
TryCmd compact ""
TryCmd cp "--version"
TryCmd cpack "--version"
TryCmd csplit "--version"
TryCmd ctest "--version"
TryCmd curl "--version"
TryCmd cut "--version"
TryCmd cygcheck "--version"
TryCmd cygpath "--version"
TryCmd d2u "--version"
TryCmd dash "--version"
TryCmd date ""
TryCmd dd "--version"
TryCmd df "--version"
TryCmd diff "--version"
TryCmd diff3 "--version"
TryCmd dir "--version"
TryCmd dircolors "--version"
TryCmd dirname "--version"
TryCmd dism ""
TryCmd dos2unix "--version"
TryCmd driverquery ""
TryCmd du "--version"
TryCmd echo "--version"
TryCmd egrep "--version"
TryCmd env "--version"
TryCmd ex "--version"
TryCmd expand "--version"
TryCmd expr "--version"
TryCmd factor "--version"
TryCmd false "--version"
TryCmd fido2-assert "--version"
TryCmd fido2-cred "--version"
TryCmd fido2-token "--version"
TryCmd file "--version"
TryCmd find "--version"
TryCmd fgrep "--version"
TryCmd fmt "--version"
TryCmd fold "--version"
TryCmd ftp "-?"
TryCmd funzip "--version"
TryCmd gawk "--version"
TryCmd gencat "--version"
TryCmd getconf "--version"
TryCmd getopt "--version"
TryCmd gettext "--version"
TryCmd gcc "--version"
TryCmd gdb "--version"
TryCmd gh "--version"
TryCmd git "--version"
TryCmd gkill "--version"
TryCmd gmondump "--version"
TryCmd gpg "--version"
TryCmd gpg-agent "--version"
TryCmd gpgconf "--version"
TryCmd gpg-error "--version"
TryCmd gpgsplit "--version"
TryCmd gpgtar "--version"
TryCmd grep "--version"
TryCmd groups "--version"
TryCmd gzip "--version"
TryCmd head "--version"
TryCmd hcsdiag ""
TryCmd help "--version"
TryCmd hmac256 "--version"
TryCmd hostid "--version"
TryCmd hostname ""
TryCmd htop "--version"
TryCmd iconv "--version"
TryCmd id "--version"
TryCmd ipfs "--version"
TryCmd java "--version"
TryCmd join "--version"
TryCmd kill "--version"
TryCmd ldd "--version"
TryCmd less "--version"
TryCmd link "--version"
TryCmd ln "--version"
TryCmd locale "--version"
TryCmd locate "--version"
TryCmd logname "--version"
TryCmd ls "--version"
TryCmd lsattr "-V"
TryCmd lsb_release ""
TryCmd lzma "--version"
TryCmd mac2unix "--version"
TryCmd make "--version"
TryCmd md5sum "--version"
TryCmd minidumper "--version"
TryCmd mkdir "--version"
TryCmd mkfifo "--version"
TryCmd mkgroup "--version"
TryCmd mknod "--version"
TryCmd mkpasswd "--version"
TryCmd mktemp "--version"
TryCmd mount "--version"
TryCmd MpCmdRun "-h"
TryCmd netsh ""
TryCmd netstat ""
TryCmd nice "--version"
TryCmd nohup "--version"
TryCmd nroff "--version"
TryCmd nslookup ""
TryCmd openssl ""
TryCmd passwd "--status"
TryCmd paste "--version"
TryCmd perl "--version"
TryCmd ping "-V"
TryCmd ping6 "-V"
TryCmd pip "--version"
TryCmd pip3 "--version"
TryCmd pip3.8 "--version"
TryCmd powercfg "/?"
TryCmd powershell "--version"
TryCmd print ""
TryCmd printf "--version"
TryCmd python "--version"
TryCmd python3 "--version"
TryCmd python3.8 "--version"
TryCmd rasdial "--version"
TryCmd regedit "--version"
TryCmd replace "--version"
TryCmd robocopy "--version"
TryCmd route ""
TryCmd rsh ""
TryCmd rsync "--version"
TryCmd rundll32 "--version"
TryCmd scp ""
TryCmd sftp ""
TryCmd sh "--version"
TryCmd sha1sum "--version"
TryCmd sha256sum "--version"
TryCmd sha512sum "--version"
TryCmd ssh "-V"
TryCmd ssh-keygen ""
TryCmd sort "--version"
TryCmd split "--version"
TryCmd strace "--version"
TryCmd strings "--version"
TryCmd strip "--version"
TryCmd sudo "--version"
TryCmd systeminfo ""
TryCmd tail "--version"
TryCmd tar "--version"
TryCmd taskkill ""
TryCmd tasklist ""
TryCmd tee "--version"
TryCmd time ""
TryCmd timeout ""
TryCmd top "-v"
TryCmd tskill ""
TryCmd typeperf ""
TryCmd tzsync "--version"
TryCmd uniq "--version"
TryCmd vi "--version"
TryCmd vim "--version"
TryCmd vulkaninfo "--version"
TryCmd w32tm "/?"
TryCmd waitfor "--version"
TryCmd wakeonlan ""
TryCmd wget "--version"
TryCmd where "--version"
TryCmd whatis "--version"
TryCmd which ""
TryCmd winget "--version"
TryCmd winsat ""
TryCmd whoami "--version"
TryCmd wput "--version"
TryCmd write ""
TryCmd wsl "--version"
TryCmd xcopy "--version"
TryCmd yes "--version"
TryCmd zip "--version"
TryCmd zipcloak "--version"
TryCmd zipdetails ""
TryCmd zipgrep ""
TryCmd zipinfo ""
TryCmd zipnote ""
TryCmd zipsplit ""
TryCmd zsh "--version"
}
try {
ListTools | Format-Table -property @{e='Name';width=12},@{e='Version';width=15},@{e='Path';width=70},@{e='FileSize';width=10}
ListCmdTools | Format-Table -property @{e='Name';width=12},@{e='Version';width=15},@{e='Path';width=70},@{e='FileSize';width=10}
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}