Updated list-scripts.ps1

This commit is contained in:
Markus 2021-02-22 20:14:44 +01:00
parent 3705f9c2dd
commit d0de5af787

View File

@ -15,14 +15,15 @@ function ListScripts { param([string]$FilePath)
'Description' = "$($Row.Description)" 'Description' = "$($Row.Description)"
} }
} }
$global:NumScripts = $Table.Count
write-progress -completed "Reading $FilePath..." write-progress -completed "Reading $FilePath..."
write-output ""
write-output "($($Table.Count) PowerShell scripts total)"
} }
try { try {
$PathToRepo = "$PSScriptRoot/.." $PathToRepo = "$PSScriptRoot/.."
ListScripts "$PathToRepo/Data/scripts.csv" | format-table -property Script,Description ListScripts "$PathToRepo/Data/scripts.csv" | format-table -property Script,Description
write-host -foregroundColor green "OK - $($global:NumScripts) PowerShell scripts total"
exit 0 exit 0
} catch { } catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"