Few days back I upload a script on “Powershell Digital Clock”, when i was writing that script at that time another script idea strike in to my mind, that ideas was to create a Stopwatch using Powershell.
I don’t know writing a script for stopwatch is a good idea or not, but i know one thing that i will learn a new thing and that may be helpful in the future.
After thinking i started writing an GUI based script to creating a stopwatch.
Powershell has open lots of possibilities for system administrators like me. We just need to imagine what we want and we able to achieve it easily using Powershell.
Last week when i take a session in Delhi User Group meeting, i told attendees that Powershell is the most easiest scripting language to be learn.
In this “Stopwatch” i used 4 buttons, one to start the clock, One to stop the clock , one to reset the stopwatch and another is for the lap.
I am not so good in designing GUI so ignore the colour of the buttons ;o).
In this script i learn few new things.
- System.Diagnostics.Stopwatch class
- Few methods of System.Diagnostics.Stopwatch class
- Make multiline textbox in powershell to auto scroll using
$textBox1.SelectionStart = $textBox1.Text.Length;
“Screenshot of the script”
Please run this script in –Sta mode