From f8e95672d4f91047bc6fb286dbbb4f19d653c4ae Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 2 Jun 2023 13:46:16 +0200 Subject: [PATCH] Update list-cli-tool.ps1 --- Scripts/list-cli-tools.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/list-cli-tools.ps1 b/Scripts/list-cli-tools.ps1 index 61378065..ced21791 100755 --- a/Scripts/list-cli-tools.ps1 +++ b/Scripts/list-cli-tools.ps1 @@ -16,9 +16,9 @@ Author: Markus Fleschutz | License: CC0 #> -function ListTool { param([string]$Cmd, [string]$VersionArg) +function ListTool { param([string]$Name, [string]$VersionArg) try { - $Info = Get-Command $Cmd -ErrorAction Stop + $Info = Get-Command $Name -ErrorAction Stop $Path = $Info.Source if ("$($Info.Version)" -eq "0.0.0.0") { if ("$VersionArg" -ne "") { @@ -37,11 +37,11 @@ function ListTool { param([string]$Cmd, [string]$VersionArg) $Version = $Info.Version } if (Test-Path "$Path" -pathType leaf) { - $FileSize = (Get-Item "$Path").Length + $Size = (Get-Item "$Path").Length } else { - $FileSize = "0" + $Size = 0 } - New-Object PSObject -Property @{ Tool=$Cmd; Version=$Version; Path=$Path; FileSize=$FileSize } + New-Object PSObject -Property @{ Tool=$Name; Version=$Version; Path=$Path; FileSize=$Size } } catch { return }