Improved the scripts

This commit is contained in:
Markus Fleschutz 2021-01-09 12:36:37 +01:00
parent f70b65d3e2
commit 77df424774
5 changed files with 10 additions and 7 deletions

View File

@ -12,7 +12,7 @@ close-windows-terminal.ps1, closes Windows Terminal gracefully
configure-git.ps1, sets up the Git configuration
csv-to-text.ps1, converts the given CSV file into a text list
decrypt-file.ps1, decrypts the given file
display-time.ps1, displays the current time
display-time.ps1, displays the current time for 10 seconds by default
download.ps1, downloads the file/directory from the given URL
empty-dir.ps1, empties the given directory
enable-crash-dumps.ps1, enables the writing of crash dumps

1 Filename Description
12 configure-git.ps1 sets up the Git configuration
13 csv-to-text.ps1 converts the given CSV file into a text list
14 decrypt-file.ps1 decrypts the given file
15 display-time.ps1 displays the current time displays the current time for 10 seconds by default
16 download.ps1 downloads the file/directory from the given URL
17 empty-dir.ps1 empties the given directory
18 enable-crash-dumps.ps1 enables the writing of crash dumps

View File

@ -20,7 +20,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol
* [configure-git.ps1](Scripts/configure-git.ps1) - sets up the Git configuration
* [csv-to-text.ps1](Scripts/csv-to-text.ps1) - converts the given CSV file into a text list
* [decrypt-file.ps1](Scripts/decrypt-file.ps1) - encrypts the given file
* [display-time.ps1](Scripts/display-time.ps1) - displays the current time
* [display-time.ps1](Scripts/display-time.ps1) - displays the current time for 10 seconds by default
* [download.ps1](Scripts/download.ps1) - downloads the file/directory from the given URL
* [empty-dir.ps1](Scripts/empty-dir.ps1) - empties the given directory
* [enable-crash-dumps.ps1](Scripts/enable-crash-dumps.ps1) - enables the writing of crash dumps

View File

@ -1,16 +1,18 @@
#!/snap/bin/powershell
<#
.SYNTAX ./display-time.ps1
.DESCRIPTION displays the current time
.SYNTAX ./display-time.ps1 [<seconds>]
.DESCRIPTION displays the current time for 10 seconds by default
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([int]$Seconds = 10)
try {
for ($i = 0; $i -lt 1000; $i++) {
$CurrentTime = Get-Date -format "yyyy-MM-dd HH:mm:ss"
for ([int]$i = 0; $i -lt $Seconds; $i++) {
clear-host
write-output ""
$CurrentTime = Get-Date -format "yyyy-MM-dd HH:mm:ss"
./write-big $CurrentTime
write-output ""
start-sleep -s 1

View File

@ -7,7 +7,7 @@
#>
try {
Get-Module
get-module | format-table
exit 0
} catch {
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -15,6 +15,7 @@ function ListScripts { param([string]$Path)
'Description' = "$($Row.Description)"
}
}
write-progress -completed "Reading $Path..."
write-output ""
write-output "($($Table.Count) PowerShell scripts total)"
}