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.

Recent Contributions:

  • beginner10_2011.ps1 by Dave Maldonado 21 Apr 2011 07:07 PM UTC
    by 2 users

    Beginner Event 10

    Measures time it takes to run a cmdlet or script block for a specified number of intervals and calculates the average. It sends results to console but can also email results of test to recipient if email parameters are supplied.

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

  • Get-StartSleepTime by Dennis W 21 Apr 2011 06:41 PM UTC
    by 2 users

    Beginner Event 10
    1 Comments

    Test accuracy of Start-Sleep command.

  • Beginner_Event_10 by Mohit Kataria 21 Apr 2011 06:03 PM UTC
    by 2 users

    Beginner Event 10
    1 Comments

    The script measures a sleep command for 5 runs and displays the user the average of all the runs in milliseconds. We can specify the number of runs as well as sleep time for the sleep command in this script.

  • BeginnerEvent10.ps1 by ScriptingWife 21 Apr 2011 04:30 PM UTC
    by 3 users

    Beginner Event 10
    1 Comments

    My submission for beginner event 10.

  • Advanced_2011_event10.ps1 by Eddy Steenbergen 21 Apr 2011 04:21 PM UTC
    by 2 users

    Advanced Event 10

    A bit like rewriting [IO.Path]::GetTempFileName() in powershell !?

  • Measure-Sleeper.ps1 by Klaas 21 Apr 2011 03:33 PM UTC
    by 2 users

    Beginner Event 10

    Gives the average time start-sleep really slept. You can choose the number of repetitions and the seconds to sleep.

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

  • CreateTempFile.ps1 by Franck RICHARD 21 Apr 2011 02:29 PM UTC
    by 2 users

    Advanced Event 10

    2011 Scripting Games Advanced Event 10: Use PowerShell to Create a Function to Create Temp Files

  • New-TempFile by Matthew Painter 21 Apr 2011 12:57 PM UTC
    by 2 users

    Advanced Event 10
    2 Comments

    Advanced Event 10 in the 2011 Scripting Games uses Windows PowerShell to create an advanced function to create temporary files.

  • Beginner10_2011.ps1 by Albert Fortes 21 Apr 2011 10:27 AM UTC
    by 2 users

    Beginner Event 10
    1 Comments

    Calculate the average execution time of a command.

  • Advanced10_2011.ps1 by Albert Fortes 21 Apr 2011 09:57 AM UTC
    by 2 users

    Advanced Event 10
    1 Comments

    Sends output to a temporary file.

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

  • New-TempFile.ps1 by spinlock 21 Apr 2011 07:01 AM UTC
    by 2 users

    Advanced Event 10

    Returns a temporary file name. If the -InputObject parameter is specified (or piped in), the contents are written to the temporary file. Accepts and acts upon -whatif, -encoding, -verbose -debug parameters Allows the user to specify which directory the tempfile is to be created in. Optionally displays the contents of the temporary file in notepad once completed (-ShowInNotepad)

  • Create-LogFile by Joe D. 21 Apr 2011 06:45 AM UTC
    by 3 users

    Beginner Event 9

    Create a file with a name that is based on a date. Prompt user for new file name if it already exists.

  • New-TempTextFile.psm1 by Kerry Boomsliter 21 Apr 2011 06:04 AM UTC
    by 2 users

    Advanced Event 10
    2 Comments

    Creates a temp file on the pipeline and returns the temp file path name. Challenge from the 2011 Scripting Games, the Advanced Event number 10. Will create an empty file if no input is provided. I believe I've hit all of the extra point requirements! Kerry Boomsliter

  • Beginner_09_2011.ps1 by David Temple 21 Apr 2011 05:48 AM UTC
    by 3 users

    Beginner Event 9
    3 Comments

    The Script will create a Log File using the Year, Month and Day (i.e. 20110421.log) This Script will verify the directories configured in this script exist. If they do exist not they will be created. To modify look for the section labeled "#Directory Configuration Array" and modify accordingly. Once the Directories are verified (or created) It beings to collect the information for the local system to determine the Log File name and if it already exists. If it does it will assign a Name to the Long File using the following Year, Month, Day, Hour, Minute and Second to avoid duplication of Log File Name. It is important to note that while the script is running it will append to the created Log File. Once the Script completes and if it is run again it will create a new log file leaving the original intact. The last process to run is a LogCleanUp Function. It is currently configured to clean up Files in the Logs Directory that are older than 15 days. If this Function is not needed a Simple Comment "#" in front of the LogCleanUp Function or deletion of that line will disable it from running. To Adjust the number of days Find the LogCleanUp Function and change the $Daysback Variable accordingly.

  • New-LogFile.ps1 by Rich Kusak 21 Apr 2011 05:14 AM UTC
    by 2 users

    Advanced Event 9

    Creates a new log file once per day. Creates parent folder if missing. Exits silently on both success and errror.

  • New-Logfile by Bill Ehardt 21 Apr 2011 04:32 AM UTC
    by 2 users

    Beginner Event 9
    1 Comments

    Creates a new logfile based on date in a specified directory

  • beginner9_2011.ps1 by Sean Massey 21 Apr 2011 04:01 AM UTC
    by 2 users

    Beginner Event 9
    1 Comments

    Beginner Event 9. I probably made this more complicated than I needed to, but I wanted to get some practice working with functions in Powershell.

  • create-file.ps1 by Tony Richards 21 Apr 2011 03:54 AM UTC
    by 3 users

    Beginner Event 9
    2 Comments

    This script creates a log file with the current date as the file name in the current directory.

  • Beginner9_2011.ps1 by Tia 21 Apr 2011 03:04 AM UTC
    by 2 users

    Beginner Event 9
    1 Comments

    Script with log function which outputs the result to host and to the log file using year, month, and day format with .log extension. It will also promt the user for a new name if file already exist and append ".log" extension if not specified.

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

  • Out-Logfile by Matt_G 21 Apr 2011 02:41 AM UTC
    by 2 users

    Beginner Event 9
    1 Comments

    Creates output to a new log file. Includes example of something slightly interesting to log.

  • adv09.ps1 by Francis D 21 Apr 2011 02:30 AM UTC
    by 2 users

    Advanced Event 9

    Create a temporary log file... for KSchulte. :-)