Update write-clock.ps1

This commit is contained in:
Markus Fleschutz 2023-07-03 21:14:17 +02:00
parent 8573fe09a9
commit 4ae2c279c7

View File

@ -4,7 +4,7 @@
.DESCRIPTION .DESCRIPTION
This PowerShell script writes the current time as ACSII clock This PowerShell script writes the current time as ACSII clock
.EXAMPLE .EXAMPLE
PS> ./write-clock PS> ./write-clock.ps1
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -12,15 +12,28 @@
#> #>
try { try {
for ([int]$i = 0; $i -lt 99999; $i++) { [system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
Clear-Host Clear-Host
Write-Output "" Write-Output ""
$Date = Get-Date -format "yyyy-MM-dd" $Weekday = Get-Date -UFormat "%A"
$Time = Get-Date -format "HH:mm:ss" & "$PSScriptRoot/write-big.ps1" " $Weekday"
& "$PSScriptRoot/write-big.ps1" $Date
& "$PSScriptRoot/write-big.ps1" $Time
Write-Output "" Write-Output ""
$Date = Get-Date -UFormat "%d%b%y"
& "$PSScriptRoot/write-big.ps1" " $Date"
Write-Output ""
$StartPosition = $HOST.UI.RawUI.CursorPosition
while ($true) {
$Time = Get-Date -format "HH:mm:ss"
& "$PSScriptRoot/write-big.ps1" " $Time "
Write-Output ""
Write-Output ""
Write-Output " (press <Ctrl> <C> to stop)"
Start-Sleep -seconds 1 Start-Sleep -seconds 1
$HOST.UI.RawUI.CursorPosition = $StartPosition
} }
exit 0 # success exit 0 # success
} catch { } catch {