From db0169521bb1143d44d141573634e85d487ea655 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sun, 24 Nov 2024 10:18:16 +0100 Subject: [PATCH] Updated list-cli-tools.ps1 --- scripts/list-cli-tools.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/list-cli-tools.ps1 b/scripts/list-cli-tools.ps1 index 15e9cf8b..7fa1c90b 100755 --- a/scripts/list-cli-tools.ps1 +++ b/scripts/list-cli-tools.ps1 @@ -6,9 +6,9 @@ .EXAMPLE PS> ./list-cli-tools.ps1 - Tool Name Version Installation Path - --------- ------- ----------------- - 7z 23.01 /usr/bin/7z (38 bytes) + TOOL VERSION INSTALLATION PATH + ---- ------- ----------------- + arp 10.0.22621.4111 C:\Windows\system32\ARP.EXE (45K) ... .LINK https://github.com/fleschutz/PowerShell @@ -53,13 +53,13 @@ function ListTool([string]$Name, [string]$VersionArg) { } else { $Size = 0 } - New-Object PSObject -Property @{ 'Tool Name'=$Name; 'Version'=$Version; 'Installation Path'="$Path ($(Bytes2String $Size))" } + New-Object PSObject -Property @{ 'TOOL'=$Name; 'VERSION'=$Version; 'INSTALLATION PATH'="$Path ($(Bytes2String $Size))" } } catch { return } } -function ListTools { +function List-CLI-Tools { ListTool 7z "-version" ListTool ant "-v" ListTool apt "--version" @@ -331,7 +331,7 @@ function ListTools { } try { - ListTools | Format-Table -property @{e='Tool Name';width=15},@{e='Version';width=15},@{e='Installation Path';width=90} + List-CLI-Tools | Format-Table -property @{e='TOOL';width=15},@{e='VERSION';width=16},@{e='INSTALLATION PATH';width=90} exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"