File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 2
2
. SYNOPSIS
3
3
Writes an ASCII clock
4
4
. DESCRIPTION
5
- This PowerShell script writes the current time as ACSII clock
5
+ This PowerShell script writes the current time as ASCII clock.
6
6
. EXAMPLE
7
7
PS> ./write-clock.ps1
8
8
. LINK
13
13
14
14
try {
15
15
[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"
16
19
17
20
Clear-Host
18
- $Weekday = Get-Date - UFormat " %A"
19
21
& " $PSScriptRoot /write-big.ps1" " $Weekday "
20
22
Write-Output " "
21
-
22
- $Date = Get-Date - UFormat " %d%b%y"
23
- & " $PSScriptRoot /write-big.ps1" " $Date "
23
+ & " $PSScriptRoot /write-big.ps1" " $Date "
24
24
Write-Output " "
25
-
26
- $Week = Get-Date - UFormat " %V"
27
- & " $PSScriptRoot /write-big.ps1" " WEEK$Week "
25
+ & " $PSScriptRoot /write-big.ps1" " WEEK $Week "
28
26
Write-Output " "
29
27
30
28
$StartPosition = $HOST.UI.RawUI.CursorPosition
31
29
while ($true ) {
32
30
$Time = Get-Date - format " HH:mm:ss"
33
-
34
31
& " $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)"
37
33
Start-Sleep - seconds 1
38
34
$HOST.UI.RawUI.CursorPosition = $StartPosition
39
35
}
Original file line number Diff line number Diff line change 2
2
. SYNOPSIS
3
3
Writes the current time
4
4
. 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 .
6
6
. EXAMPLE
7
- PS> ./write-time
7
+ PS> ./write-time.ps1
8
+ 🕒7:20 PM
8
9
. LINK
9
10
https://github.com/fleschutz/PowerShell
10
11
. NOTES
You can’t perform that action at this time.
0 commit comments