Scripto Bobble-head Games Logo

Welcome to PoshCode and the 2011 Scripting Games!

The Scripting Games are a special event put on by the Microsoft scripting guys. Script submissions, grading, and script archives are hosted by PoshCode.org. You may want to check out the Official Rules, and the Scripting Games Information page for event information and contest details, since this site is purely for submitting your contest entry!

Remember: You will not be able to see other user's scripts until after the deadline for an event has passed, and you will not be able to submit scripts for an event once that event has passed.

Note: If you have any problems logging in, please clear your cookies. If you still have problems, please use the "Contact Us" tab above or post directly on GetSatisfaction.

Searching for Scripts in category 'Beginner Event 10'

  • SG2011_Beginner10 by KSchulte 16 Apr 2011 03:08 PM UTC
    by 2 users

    Beginner Event 10
    4 Comments

    Beginner Event 10 in 2011 Scripting Games uses Windows PowerShell to determine the amoun of time a command takes to complete.

  • Get-AverageRunTime by Jeff Patton 15 Apr 2011 03:30 PM UTC
    by 2 users

    Beginner Event 10
    3 Comments

    This function returns the average time in milliseconds for a command to run over several iterations. Simply pass in the number of iterations, and the script block you wish to test. For the purposes of the ScriptingGames I have commented out the ScriptBlock variable, but in actuality you *should* be able to pass this function a block of code to run and number of iterations and it will return the proper value for you. Uncomment out the comments in the following lines 61, 62, 72 Comment out the following lines 66, 67, 71

  • Beginner10_2011.ps1 by Jeremy Cox 18 Apr 2011 05:38 PM UTC
    by 2 users

    Beginner Event 10
    3 Comments

  • Test-SleepPrecision by Daniel Dittenhafer 21 Apr 2011 02:42 AM UTC
    by 2 users

    Beginner Event 10
    3 Comments

    Script to test Start-Sleep based on a specified sample size and sleep duration. Uses [System.Diagnostics.Stopwatch] and Start-Sleep to time the execution of the Start-Sleep commands.

  • 10_sg_beginner by AdamZ 15 Apr 2011 12:32 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    Script to Measure Time to Complete a Command

  • MeasureTime.ps1 by Tron04 15 Apr 2011 01:32 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    Use PowerShell to Measure Time to Complete a Command

  • Test-TimeAccuracy by Jeremy Dunlop 15 Apr 2011 11:03 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    This script will test the accuracy of running the Start-Sleep cmdlet on your computer.

  • Count_Sleep.ps1 by Aaron Bednar 16 Apr 2011 10:27 PM UTC
    by 3 users

    Beginner Event 10
    2 Comments

    This script tests the accuracy of the Start-Sleep command by timing the average of 5 runs of it at 5 seconds each. The script contains a function to allow variance on the amount of time to sleep and the amount of times to test Start-Sleep.

  • #Pass the parameter for which you want to average out the start-sleep commands in seconds, default is 5 sec by Vinay 17 Apr 2011 06:49 PM UTC
    by 3 users

    Beginner Event 10
    2 Comments

    Measure-command for start-sleep

  • Get-AverageRunTime by bmorrison 18 Apr 2011 03:15 AM UTC
    by 3 users

    Beginner Event 10
    2 Comments

    Gets the Average run time of 'Start-Sleep 5" ran 5 times Allows a user to specify running command more/less than the default 5 times Allows a user to specify a command other than 'Start-Sleep 5' to run

  • Sleep-Check by BradC 18 Apr 2011 06:33 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    Test the accuracy of the Start-Sleep command

  • Get-Sleeptime by Mark Stam 18 Apr 2011 07:37 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    This script consists of a function, which takes multiple measurements of a PowerShell command (in this case Start-Sleep) and provides the average time in milliseconds.

  • PS_Command_Average_timecounter by Scott A. Alvarino 19 Apr 2011 04:51 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    This script checks the average time it takes to complete. you can supply t a command as a argument or you don't have to put an argument and will run the command from the event showing you the average time for that.

  • Beginner10_2011_andre.gibel.ps1 by Andre Gibel - CH 20 Apr 2011 05:37 PM UTC
    by 3 users

    Beginner Event 10
    2 Comments

    Beginner10_2011_andre.gibel.ps1

  • BeginnerEvent10 by Adam Bacon 20 Apr 2011 08:32 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    Working out the average for a given time value after that value has been repeated a given number of times. I decided to use parameters in this script to make more re-usable, and finally add official help and examples to run the script as well as useful comments throughout the script, and basic error handling.

  • Beginner_Event10.ps1 by Debra D. 21 Apr 2011 07:24 AM UTC
    by 3 users

    Beginner Event 10
    2 Comments

    Output the average time for Start-Sleep command to execute.

  • beginner10_2011.ps1 by Sean Massey 21 Apr 2011 02:41 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    Measure time that Start-Sleep takes to complete.

  • get-ExecutionTime.ps1 by Brian T Young 21 Apr 2011 06:57 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    This script will execute the specified scriptblock the number of runs specified and reports back the average time taken in milliseconds.

  • beginner 10 by Chris Seiter 21 Apr 2011 08:56 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    report back average time a command was run for a specified number of times.

  • Beginner_10_2011.ps1 by David Temple 21 Apr 2011 11:56 PM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    SYNOPSIS Finds the Average Milliseconds for a CMDLET or Oneliner. DESCRIPTION The Script will process a provided CMDLET or Onliner and determine the Average Millisecond Time it took for PowerShell to run it. IT IS IMPORTANT TO SURROUND THE VALUE OF CMDLET WITH SINGLE QUOTES. PLEASE SEE THE EXAMPLES. After the process finishes it will report the following for example: "Average time of 5 runs of 5 seconds is 4998.5468 milliseconds." PARAMETERS -Iterations Iterations indicates how many times this process will loop through the provided CMDLET or Oneliner (Note: The default value is "5") -CMDLET Name of the CMDLET (with or without Parameters) and or a Oneliner. IT IS IMPORTANT TO SURROUND THE VALUE OF CMDLET WITH SINGLE QUOTES. (Note: You must enter a CMDLET Parameter. It is Mandatory and will prompt you if you forget. Again if you use a CMDLET with Parameters or you are using a Oneliner, surround the CMDLET Value with Single Quotes. See Examples) EXAMPLE .\Beginner_10_2011.ps1 -Iterations 5 -CMDLET 'Start-Sleep -Seconds 5' Average time of 5 runs of 5 seconds is 5004.4389 milliseconds. NOTE: The Single Quotes. EXAMPLE .\Beginner_10_2011.ps1 -CMDLET 'Get-ChildItem -Path C:\Windows\System32 -Filter "*.dll"' Average time of 5 runs of 5 seconds is 150.44608 milliseconds. NOTE: The Single Quotes. EXAMPLE .\Beginner_10_2011.ps1 -Iterations 2 -CMDLET 'Get-ChildItem C:\Windows -Filter "*.txt" -Recurse' Average time of 2 runs of 5 seconds is 821.15165 milliseconds. NOTE: The Single Quotes.

  • B_Event_10.ps1 by Eric Pankowski 22 Apr 2011 01:17 AM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    Run the Start-Sleep cmdlet a number of times for a set duration and then report the average amount of time it took to complete each run in milliseconds.

  • Measure-ScriptBlockAverageTime.ps1 by Frank ERBLAND 22 Apr 2011 02:05 AM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    This script measure the average time a scriptblock takes to execute. It runs the scripblock n times and compute the average time with Measure-Command cmdlet. It display a formal message according the asked time unit. By default : It measures the scriptblock {Start-Sleep -Second 5}, 5 times, and shows average result in milliseconds (with 5 digits after decimal point). It also writes the result to the pipeline as an Microsoft.PowerShell.Commands.GenericMeasureInfo object. Possible intermediate results in verbose mode and a progress bar.

  • Measure-Average.ps1 by Daniel Cruz 22 Apr 2011 02:07 AM UTC
    by 2 users

    Beginner Event 10
    2 Comments

    Function: Measures the average amount of time it takes to run a specified command.

  • TimingIsEverything by Joe D. 22 Apr 2011 06:30 AM UTC
    by 4 users

    Beginner Event 10
    2 Comments

    Determine the amount of time a command takes to complete.

  • Beginner10_2011 by Srikanth 15 Apr 2011 10:10 AM UTC
    by 2 users

    Beginner Event 10
    1 Comments