Tuesday, April 23, 2013

Powershell Script : Stopwatch


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.

Lesson Learned:

  • 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;


23-04-2013 22-51-47 23-04-2013 22-55-52  

“Screenshot of the script”

Please run this script in –Sta mode

23-04-2013 22-54-51

Download Link : https://dl.dropboxusercontent.com/u/17858935/StopWatch-Community-Edition.zip


Aman Dhally
clip_image001 clip_image002 clip_image003 clip_image005clip_image007

No comments:

Post a Comment