-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTime.ps1
More file actions
20 lines (17 loc) · 688 Bytes
/
Time.ps1
File metadata and controls
20 lines (17 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function Get-Time {
$currentTime = (Get-Date -Format "HH:mm:ss")
$ggoledCommand = "ggoled text ""$currentTime"" -C -x c -y c -a c"
# Write-Host "[DEBUG] Command created (Before): " $ggoledCommand
Write-Host "Time : " $currentTime
return $ggoledCommand
}
# Continuously executes the code
while ($true) {
# Calls Get-MediaTitle to get the GGOLED command.
$ggoledCommand = Get-Time
# Write-Host "[DEBUG] Command created (After): " $ggoledCommand "`n"
# Executes the GGOLED command using Invoke-Expression.
Invoke-Expression $ggoledCommand
# Sleeps for 1 second to avoid excessive CPU usage.
Start-Sleep -Seconds 1
}