PowerShell/Scripts/list-scripts.ps1

26 lines
691 B
PowerShell
Raw Normal View History

2020-12-29 15:37:12 +01:00
#!/snap/bin/powershell
<#
.SYNTAX ./list-scripts.ps1
.DESCRIPTION lists the PowerShell scripts in this repository
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
2021-01-02 11:08:59 +01:00
$PathToRepo = "$PSScriptRoot/.."
2020-12-29 15:37:12 +01:00
try {
2020-12-29 15:48:24 +01:00
write-progress "Reading Data/scripts.csv..."
2020-12-29 15:37:12 +01:00
$Table = import-csv "$PathToRepo/Data/scripts.csv"
write-output ""
2020-12-29 15:54:39 +01:00
write-output "Collection of $($Table.Count) PowerShell Scripts"
write-output "==================================="
2020-12-29 15:37:12 +01:00
foreach($Row in $Table) {
write-output "* $($Row.Filename) - $($Row.Description)"
}
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}