Skip to content

Commit 18e4f20

Browse files
committed
Update write-clock.ps1 and write-time.ps1
1 parent aa67a45 commit 18e4f20

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

Scripts/write-clock.ps1

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.SYNOPSIS
33
Writes an ASCII clock
44
.DESCRIPTION
5-
This PowerShell script writes the current time as ACSII clock
5+
This PowerShell script writes the current time as ASCII clock.
66
.EXAMPLE
77
PS> ./write-clock.ps1
88
.LINK
@@ -13,27 +13,23 @@
1313

1414
try {
1515
[system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
16+
$Weekday = Get-Date -UFormat "%A"
17+
$Date = Get-Date -UFormat "%d %b %Y"
18+
$Week = Get-Date -UFormat "%V"
1619

1720
Clear-Host
18-
$Weekday = Get-Date -UFormat "%A"
1921
& "$PSScriptRoot/write-big.ps1" " $Weekday"
2022
Write-Output ""
21-
22-
$Date = Get-Date -UFormat "%d%b%y"
23-
& "$PSScriptRoot/write-big.ps1" " $Date"
23+
& "$PSScriptRoot/write-big.ps1" " $Date"
2424
Write-Output ""
25-
26-
$Week = Get-Date -UFormat "%V"
27-
& "$PSScriptRoot/write-big.ps1" " WEEK$Week"
25+
& "$PSScriptRoot/write-big.ps1" " WEEK $Week"
2826
Write-Output ""
2927

3028
$StartPosition = $HOST.UI.RawUI.CursorPosition
3129
while ($true) {
3230
$Time = Get-Date -format "HH:mm:ss"
33-
3431
& "$PSScriptRoot/write-big.ps1" " $Time "
35-
Write-Output ""
36-
Write-Output " (press <Ctrl> <C> to stop)"
32+
Write-Output "`n (press <Ctrl> <C> to stop)"
3733
Start-Sleep -seconds 1
3834
$HOST.UI.RawUI.CursorPosition = $StartPosition
3935
}

Scripts/write-time.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
.SYNOPSIS
33
Writes the current time
44
.DESCRIPTION
5-
This PowerShell script determines and writes the current time.
5+
This PowerShell script queries the current time and writes it to the console.
66
.EXAMPLE
7-
PS> ./write-time
7+
PS> ./write-time.ps1
8+
🕒7:20 PM
89
.LINK
910
https://github.com/fleschutz/PowerShell
1011
.NOTES

0 commit comments

Comments
 (0)