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 'Advanced Event 9'

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

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

  • Advanced9_2011.ps1 by Jonathan Tyler 21 Apr 2011 02:22 AM UTC
    by 2 users

    Advanced Event 9

    This script will create a daily log file for the current user in the HSGLogFiles folder under the user's Document folder. If the folder does not exist, it will create it. If the file already exists, the script will exit. NOTE

  • Advanced9.ps1 by ICC_RDurkin 20 Apr 2011 10:56 PM UTC
    by 2 users

    Advanced Event 9
    1 Comments

    Function will enable logging within the current PowerShell session by using Start-Transcript. Logs will be saved to the "HSGLogFiles" directory withing the users documents directory. Function will also set exit event to stop the logging when script that calls the function completes.

  • get-LogFileName.ps1 by spinlock 20 Apr 2011 10:22 PM UTC
    by 2 users

    Advanced Event 9

    Meets and exceeds all the design points. Even checks that the directory exists, and is a directory and not some sort of leaf container.

  • New-LogFile by Miklos Karasz 20 Apr 2011 09:58 PM UTC
    by 3 users

    Advanced Event 9
    1 Comments

    Creates an empty logfile. Existing one will not be overwritten. The filename looks like "<yyyyMMdd>_<Username>.log" as default. Creates the parent directory also when it doesn't exist. The parent directory is HSGLogFiles as default under the current user's MyDocuments special folder.

  • CreateLogFile.ps1 by Franck RICHARD 20 Apr 2011 09:05 PM UTC
    by 2 users

    Advanced Event 9

    2011 Scripting Games Advanced Event 9: Use PowerShell to Create a File Name Based on Date and Username

  • Advanced9_2011.ps1 by Albert Fortes 20 Apr 2011 07:44 PM UTC
    by 2 users

    Advanced Event 9

    Create a logging file name based on the date and the user's name.

  • Advanced_9.ps1 by Justin Stokes 20 Apr 2011 07:30 PM UTC
    by 2 users

    Advanced Event 9

    Solution to Advanced Event 9

  • Advanced_Event_9 by Mohit Kataria 20 Apr 2011 07:16 PM UTC
    by 2 users

    Advanced Event 9

    This script creates a daily log file for each user who is working on the system. It creates the log files in a folder called HSGLogFiles in the logged in user's My document folder. If the folder HSGLogFiles does not exist, the script creates it. Then it creates a log file after checking the existence of the same in the folder HSGFiles. If the file with same name does not exist, it creates it else displays a message to the user to use a unique file name.

  • Out-LogFile.ps1 by Robert van den Nieuwendijk 20 Apr 2011 07:10 PM UTC
    by 2 users

    Advanced Event 9

    Submission for the 2011 Scripting Games Advanced Event 9. Sends output to a log file.

  • New-LogFile by Jacques 20 Apr 2011 04:20 PM UTC
    by 2 users

    Advanced Event 9

    New-LogFile creates a log file under <My Documents>\HSGLogFiles. The log file is composed of the current date followed by the current user name. If the directory does not exist, the script creates it. If there is a file with the same name already, the script does nothing.

  • Write-Log by Seán Lillis 20 Apr 2011 03:55 PM UTC
    by 2 users

    Advanced Event 9

    Silently creates the Log directory and log file if they didn't exist. Only writes content to log file if it didn't previously exist. Accepts a string as an argument to add content to the log file.

  • Advanced_2011_event9.ps1 by Eddy Steenbergen 20 Apr 2011 02:20 PM UTC
    by 2 users

    Advanced Event 9

    Thought about the possiblity that the script might run as a scheduled task - wondered how the script could determine that. Would use WMI to determine currently logged on user in that case.

  • AdvancedEvent9 by Nuno Mota 20 Apr 2011 11:27 AM UTC
    by 3 users

    Advanced Event 9

  • Create-HSGLog by Jozsef Gerse 20 Apr 2011 09:38 AM UTC
    by 3 users

    Advanced Event 9
    1 Comments

    SG2011 Adv09 event

  • New-UserLogFile by Peter Rossi 20 Apr 2011 06:57 AM UTC
    by 3 users

    Advanced Event 9

    Creates a log file in HSGLogFiles in the current interactive users My Documents folder Full inline help included Option to specify the date formatting string Option to return the filename to the pipeline if you so wish.

  • advanced 9 by Chris Seiter 19 Apr 2011 08:22 PM UTC
    by 2 users

    Advanced Event 9
    2 Comments

    create a log file with current date and username in specified folder.

  • create-hsglogfile by Thomas Paetzold 19 Apr 2011 08:05 PM UTC
    by 3 users

    Advanced Event 9
    1 Comments

  • create_log_user&date_included by Scott A. Alvarino 19 Apr 2011 06:13 PM UTC
    by 3 users

    Advanced Event 9
    1 Comments

    This script creates a log file inside the users my documents folder that has a folder named hsglogfiles. If folder or file not created it will create it on its own.

  • New-HSGLog by Matthew Painter 19 Apr 2011 09:45 AM UTC
    by 2 users

    Advanced Event 9
    2 Comments

    Advanced Event 9 in 2011 Scripting Games uses Windows PowerShell to create a file name that is based on the date and the user’s name. The additional features of this script are: 1. Have created a reusable Advanced Function. 2. Accepts pipeline input 3. Save to specific folder or default to current user's My Documents folder. 4. Creates the target folder if required. 5. Option to record log success and failures to Application Eventlog. 6. Option to save log file in different encoding formats. 7. The function is reusable by supplying different parameters. 8. Has error trapping - with user friendly messages (via -verbose). 9. Useful help information is provided, complete with sample usage. Thanks for rating my script.

  • SG_Adv9.ps1 by Pak Yeung 19 Apr 2011 03:36 AM UTC
    by 2 users

    Advanced Event 9
    1 Comments

    This is a simple script, but it has all the requirements. Thank you

  • bpfinn_adv09.ps1 by 98d0d0c4b2ec3108763ceb1cc9a64141 18 Apr 2011 08:35 PM UTC
    by 3 users

    Advanced Event 9

    This script check to see where the HSGLogFiles directory for the user is. If there is no HSGLogFile directory, the script will create one. It will then place data into a text log file with the name of the file based on the current user and the date. If the file already exists, a new file will not be created.

  • write-logfile by Nathan Linley 18 Apr 2011 12:36 AM UTC
    by 2 users

    Advanced Event 9

    Basic helper script to send any data to a log file. The user can provide a folder name for the log files to be created in. It will ensure the folder name provided exists within the user's My Documents folder. If it doesn't exist, it will be created. The file names are auto generated using the date and the user's name. Log files are automatically overwritten if they already exist (as per event guide). Encoding can be provided as an optional parameter. The Data parameter is the information to be written to file, and this can be piped into the script. Appending is an optional parameter if log files do not need to be overwritten. Script also implements whatif

  • Set-UserLog.ps1 by Matthew BETTON 17 Apr 2011 08:30 PM UTC
    by 2 users

    Advanced Event 9
    1 Comments

    The Set-UserLog function should be used in a user logon script. If it does not exist, the 'HSGLogFiles' folder is created under 'C:\Users \Public\Documents' folder, so all computer's users should see it under their 'Documents' folder. If log file already exists, the script exits gracefully and silently. The log file is named with the date and the current login username. You can use $DebugPreference variable in order to get DEBUG messages ($DebugPreference = "Continue").