mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-30 21:54:43 +02:00
Updated list-cli-tools.ps1
This commit is contained in:
parent
315ef40d6f
commit
67dc2a2d41
@ -6,8 +6,8 @@
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./list-cli-tools.ps1
|
PS> ./list-cli-tools.ps1
|
||||||
|
|
||||||
TOOL VERSION INSTALLATION PATH
|
NAME VERSION PATH
|
||||||
---- ------- -----------------
|
---- ------- ----
|
||||||
arp 10.0.22621.4111 C:\Windows\system32\ARP.EXE (45K)
|
arp 10.0.22621.4111 C:\Windows\system32\ARP.EXE (45K)
|
||||||
...
|
...
|
||||||
.LINK
|
.LINK
|
||||||
@ -53,7 +53,7 @@ function ListTool([string]$Name, [string]$VersionArg) {
|
|||||||
} else {
|
} else {
|
||||||
$Size = 0
|
$Size = 0
|
||||||
}
|
}
|
||||||
New-Object PSObject -Property @{ 'TOOL'=$Name; 'VERSION'=$Version; 'INSTALLATION PATH'="$Path ($(Bytes2String $Size))" }
|
New-Object PSObject -Property @{ 'NAME'=$Name; 'VERSION'=$Version; 'PATH'="$Path ($(Bytes2String $Size))" }
|
||||||
} catch {
|
} catch {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -336,7 +336,7 @@ function List-CLI-Tools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List-CLI-Tools | Format-Table -property @{e='TOOL';width=15},@{e='VERSION';width=16},@{e='INSTALLATION PATH';width=90}
|
List-CLI-Tools | Format-Table -property @{e='NAME';width=15},@{e='VERSION';width=16},@{e='PATH';width=90}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user