Update write-clock.ps1 and write-time.ps1

This commit is contained in:
Markus Fleschutz 2023-08-06 19:31:40 +02:00
parent aa67a452f8
commit 18e4f20852
2 changed files with 10 additions and 13 deletions

View File

@ -2,7 +2,7 @@
.SYNOPSIS
Writes an ASCII clock
.DESCRIPTION
This PowerShell script writes the current time as ACSII clock
This PowerShell script writes the current time as ASCII clock.
.EXAMPLE
PS> ./write-clock.ps1
.LINK
@ -13,27 +13,23 @@
try {
[system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
$Weekday = Get-Date -UFormat "%A"
$Date = Get-Date -UFormat "%d %b %Y"
$Week = Get-Date -UFormat "%V"
Clear-Host
$Weekday = Get-Date -UFormat "%A"
& "$PSScriptRoot/write-big.ps1" " $Weekday"
Write-Output ""
$Date = Get-Date -UFormat "%d%b%y"
& "$PSScriptRoot/write-big.ps1" " $Date"
& "$PSScriptRoot/write-big.ps1" " $Date"
Write-Output ""
$Week = Get-Date -UFormat "%V"
& "$PSScriptRoot/write-big.ps1" " WEEK$Week"
& "$PSScriptRoot/write-big.ps1" " WEEK $Week"
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 " (press <Ctrl> <C> to stop)"
Write-Output "`n (press <Ctrl> <C> to stop)"
Start-Sleep -seconds 1
$HOST.UI.RawUI.CursorPosition = $StartPosition
}

View File

@ -2,9 +2,10 @@
.SYNOPSIS
Writes the current time
.DESCRIPTION
This PowerShell script determines and writes the current time.
This PowerShell script queries the current time and writes it to the console.
.EXAMPLE
PS> ./write-time
PS> ./write-time.ps1
🕒7:20 PM
.LINK
https://github.com/fleschutz/PowerShell
.NOTES