We are a team of six people participating to the Winter Scripting Games 2014 (PowerShell Script language). This repository is holding our team work accomplished during each events.
- Francois-Xavier Cat (Canada GMT -5:00) @LazyWinAdm - Blog
- Stephane Van Gulick (Switzerland GMT+1:00) @Stephanevg - Blog
- Deepak Dhami (India GMT+5:30) @DexterPOSH - Blog
- Allister Philippe (France GMT+1:00)
- Benjamin Rouleau (France GMT+1:00)
- Guido Oliviera (Brazil GMT -3:00) @_Guido_Oliveira - Blog
- Analyze the scenario/requirements and establish a plan/strategy (CF Event0-Strategy.md)
- Create the script structure (Think about the performance impact, Error handling, loop,...)
- Split the work if possible (Sections, differents functions...)
- Assign one person to post the script regularly to get input from Coaches
- Github issue tracking
- Discussion forum of our team in scriptinggames.org
- Milestone 1: Make the script work
- Milestone 2: Performance
- Test and Test and Test
From the ebook "PowerShell.org Pratices" (nov 2013)
- Comment based help
- Describe each parameter
- Provide usage examples
- Use the Notes Section for detail on how the tool works
- Keep your language simple
- Comment your inline code
- Keep it simple
- Don't over comment
- Versioning
- Write for the lowest version of PowerShell that you can
- Document the version of PowerShell the script was written for (#requires)
- Performance
- If performance matters, test it
- consider trade-offs between performance and readability
- Aesthetics
- Indent your code
- Avoid Backtick
- Output
- Avoid write-host unless writing to the host is the only goal
- Use write-verbose to give information to someone running the script
- Use write-debug to give information to someone maintaining the script
- Use [Cmdletbinding()] if you are using verbose and debug
- Tools vs Controller
- Decide whether you're coding a tool (reusable tool(s)) or controller script (one purpose, not really reusable)
- Make your code modular
- Make tools as re-usable as possible
- Use PowerShell standard cmdlet naming
- Use PowerShell standard parameter naming
- Tools should output raw data
- Contollers script should typically output formatted data
- Purity laws
- Use native powershell where possible
- If you can't use PowerShell, use .NET, external commands, COM objects,...
- Document why you did not use PowerShell
- Wrap other tools in an advanced function of cmdlet
- Pipelines vs Constructs
- Avoid using pipelines in scripts
- Trapping and Capturing Errors
- Use -ErrorAction Stop when calling cmdlets
- Use $ErrorActionPreference='Stop'/'Continue' when calling cmdlets
- Avoid using Flags to handle errors
- Avoir using $?
- Avoid testing for a null variable as an error condition
- Copy $Error[0] to your own variable
- Wasted Effort
- Don’t re-invent the wheel
- Report bugs to Microsoft
- Instruction available: 2014/01/01 00:00 UTC
- Entries accepted starting: 2014/01/06 00:00 UTC
- All entries due by: 2014/01/12 00:00 UTC
- Public browsing of entries starts: 2014/01/12 00:00 UTC
- Judging completed by: 2014/01/18 00:00 UTC
- Instruction available: 2014/01/18 00:00 UTC
- Entries accepted starting: 2014/01/19 00:00 UTC
- All entries due by: 2014/01/26 00:00 UTC
- Public browsing of entries starts: 2014/01/26 00:00 UTC
- Judging completed by: 2014/02/01 00:00 UTC
- Instruction available: 2014/01/25 00:00 UTC
- Entries accepted starting: 2014/01/26 00:00 UTC
- All entries due by: 2014/02/02 00:00 UTC
- Public browsing of entries starts: 2014/02/02 00:00 UTC
- Judging completed by: 2014/02/08 00:00 UTC
- Instruction available: 2014/02/01 00:00 UTC
- Entries accepted starting: 2014/02/02 00:00 UTC
- All entries due by: 2014/02/09 00:00 UTC
- Public browsing of entries starts: 2014/02/09 00:00 UTC
- Judging completed by: 2014/02/15 00:00 UTC
- Instruction available: 2014/02/08 00:00 UTC
- Entries accepted starting: 2014/02/09 00:00 UTC
- All entries due by: 2014/02/16 00:00 UTC
- Public browsing of entries starts: 2014/02/16 00:00 UTC
- Judging completed by: 2014/02/22 00:00 UTC