mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-21 23:43:25 +01:00
Update write-clock.ps1 and write-time.ps1
This commit is contained in:
parent
aa67a452f8
commit
18e4f20852
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user