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 tagged 'ATLPUG'

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

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

  • Beginner_08_2011.ps1 by David Temple 20 Apr 2011 05:22 AM UTC
    by 2 users

    Beginner Event 8
    5 Comments

    Finds all files in the Directory provided. The Script will write the following information to a CSV File: Name of the File Found - Name Size of the File Found - File Size in (bytes) When the File was last written to = LastWriteTime After the process finishes it will open the CSV File, provided Excel is installed.

  • Beginner_07_2011.ps1 by David Temple 16 Apr 2011 06:33 AM UTC
    by 2 users

    Beginner Event 7
    1 Comments

    The Script will echo the following information to the host: "There are XXX days until the end of the fiscal year." Note: A quick Edit of the Switch Parameters "-Year, -Month or -Day" will allow this basic script to be reused next year (and the year after that and so on).

  • Beginner_06_2011.ps1 by David Temple 16 Apr 2011 05:05 AM UTC
    by 2 users

    Beginner Event 6
    1 Comments

    The Script will check for the existence of the word "failed" located in the WindowsUpdate.Log file and echoes the information to the host. Below is the shortest I could get the one liner. GC is the alias for "Get-Content" which I pipe over to "Select-String" which does not have an alias. "-Patt" is the shortest switch parameter I could use without confusing folks with the "-Path" Switch Parameter. I did test without the "-Pattern" Switch Parameter which the "Select-String" was intelligent enough to figure out from the information I was passing to it that it was not a path statement but a pattern, however I thought it would be best practice to include the Switch Parameter.

  • Beginner_05_2011.ps1 by David Temple 15 Apr 2011 04:37 AM UTC
    by 2 users

    Beginner Event 5

    Connects to a List of Computers (if a ListOfComputers.txt file exists) or connects to the Local Computer to collect the user name, computer name, domain name, and the operating system information and logs it to a text file named Basic_Computer_Information.txt

  • Beginner_03_2011.ps1 by David Temple 14 Apr 2011 06:37 AM UTC
    by 2 users

    Beginner Event 4
    2 Comments

    Generates a List of Services and is sorted by by the Service Account Name

  • get-eventlogdetails by William Murphy 12 Apr 2011 07:03 PM UTC
    by 2 users

    Beginner Event 3

    get-eventlogdetails list classic event and ETL logs. Sorts by last write time by default but additional sort options are available via the -CustomSort parameter

  • Get-PauseableService by David Temple 12 Apr 2011 05:51 AM UTC
    by 2 users

    Beginner Event 2

    Get-PauseableService displays Running Services that can be Paused. In addition you can name a remote machine or supply a path to a text file to work with a list of remote machines. If you do not supply a Status of 'Running', 'Stopped' or 'Paused' it will run against all of the Services regardless of status to determine if a Service can be paused.

  • Get-PrivateBuildInfo by William Murphy 11 Apr 2011 06:08 PM UTC
    by 2 users

    Beginner Event 1

    Get-PrivateBuildInfo checks to see if the specified process is running. If it is it tries to determine whether the PrivateBuild flag is set in the VersionInfo

  • Beginner_01_2011.ps1 by David Temple 11 Apr 2011 04:25 AM UTC
    by 2 users

    Beginner Event 1
    2 Comments

    Unfortunately, this does not solve the issue presented in 2001 Scripting Games Event 1. My limited Scripting abilities got me stuck at this point. I am hoping for some direction so that I can finish this challenge on my own. I am not even sure if I was headed in the right direction. Thanks in Advance, David

  • get-pauseableservice by William Murphy 10 Apr 2011 10:06 PM UTC
    by 2 users

    Beginner Event 2

    Get-PauseableService checks runninger services for the CanPauseandContinue option.