mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-04 23:54:59 +02:00
Update write-clock.ps1
This commit is contained in:
parent
8573fe09a9
commit
4ae2c279c7
@ -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
|
|
||||||
Write-Output ""
|
Clear-Host
|
||||||
$Date = Get-Date -format "yyyy-MM-dd"
|
Write-Output ""
|
||||||
|
$Weekday = Get-Date -UFormat "%A"
|
||||||
|
& "$PSScriptRoot/write-big.ps1" " $Weekday"
|
||||||
|
|
||||||
|
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"
|
$Time = Get-Date -format "HH:mm:ss"
|
||||||
& "$PSScriptRoot/write-big.ps1" $Date
|
|
||||||
& "$PSScriptRoot/write-big.ps1" $Time
|
& "$PSScriptRoot/write-big.ps1" " $Time "
|
||||||
Write-Output ""
|
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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user