PowerShell Clock
A command line live-updating clock with weather.
In my ongoing learning of PowerShell, I have recently discovered how useful the Write-Progress
cmdlet is. Waiting for a long-running process to finish in PowerShell or the Command Prompt was always a pain in the past with no status updates, but Write-Progress
provides a great, customizable way to provide feedback.
One of the options of Write-Progress
is to output multiple progress bars for the same status. In thinking of places that I could use those multiple progress bars, I thought a clock would be a great way to demonstrate how it works. So I created progress bars for hours, minutes, and seconds, borrowed some logic to convert those values to words from Stack Overflow, and found a nice little command line service that shows the current weather to finish it off.
Here is the result. It can be ran from anywhere a command can be executed, and will launch a new PowerShell console if it’s not there already.