{"id":3019,"date":"2013-05-13T09:49:16","date_gmt":"2013-05-13T13:49:16","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3019"},"modified":"2013-07-02T08:14:48","modified_gmt":"2013-07-02T12:14:48","slug":"powershell-scripting-games-2013-impressions","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/","title":{"rendered":"PowerShell Scripting Games 2013 Impressions"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft\" alt=\"\" src=\"http:\/\/scriptinggames.org\/games-logo.png\" width=\"400\" height=\"150\" \/>Now that the PowerShell Scripting Games for 2013 are well underway, I thought I'd share my thoughts and impressions on what I've seen. I'm very impressed with the number of entries and generally the quality is pretty good. But as a judge I see repeated items that bear comment. These comments are in no particular order of importance and in some cases are really a matter of personal preference.<\/p>\n<p>If you are going to use Write-Host (and want to save puppies) to display informational or progress messages, please use one of the color parameters so that your message can be differentiated from your object output. Ideally for advanced events you should be using Write-Progress. Not sure we've had events that call for Write-Progress but keep it in mind.<\/p>\n<p>I generally dislike entries that are clearly overwrought and over-thought. Sometimes the problem can be solved simply. Don't feel you have to use every trick in the PowerShell play book in order to score points. I'm a big proponent of the right tool for the job. On a related note, if you can solve the challenge with a PowerShell one-liner, don't feel you need to write it as a long single line command. Take advantage of PowerShell parsing. This is very hard to read:<\/p>\n<pre class=\"lang:ps decode:true\">Get-WmiObject win32_operatingsystem -comp $computers | select PSComputername,@{Name=\"TotalMemoryMB\";Expression={[int]($_.TotalVisibleMemorySize\/1KB)}},@{Name=\"FreeMemoryMB\";Expression={[math]::Round($_.FreePhysicalmemory\/1KB,2)}},@{Name=\"PercentMemoryFree\";Expression={[math]::Round(($_.freephysicalmemory\/$_.totalvisibleMemorySize)*100,2)}} | Sort PSComputername | Export-CSV -Path c:\\work\\osreport.csv -Encoding ASCII -NoTypeInformation<\/pre>\n<p>I'd much rather see a one-liner formatted like this:<\/p>\n<pre class=\"lang:ps decode:true\">Get-WmiObject win32_operatingsystem -comp $computers | \r\nselect PSComputername,\r\n@{Name=\"TotalMemoryMB\";Expression={[int]($_.TotalVisibleMemorySize\/1KB)}},\r\n@{Name=\"FreeMemoryMB\";Expression={[math]::Round($_.FreePhysicalmemory\/1KB,2)}},\r\n@{Name=\"PercentMemoryFree\";\r\nExpression={[math]::Round(($_.freephysicalmemory\/$_.totalvisibleMemorySize)*100,2)}} |\r\nSort PSComputername | \r\nExport-CSV -Path c:\\work\\osreport.csv -Encoding ASCII -NoTypeInformation<\/pre>\n<p>In full scripts, I'd like to see more use of #Requires -version X so that I can tell what features you might be using. Related to that, in advanced scripts if you are using a parameter attribute like Mandatory or ValueFromPipeline, v3 scripts should use them like this:<\/p>\n<pre class=\"lang:ps decode:true\">[Parameter(Position=0,ValueFromPipeline,Mandatory)]<\/pre>\n<p>You don't have to explicitly state that Mandatory is equal to True. Although in v2 you would need to do this:<\/p>\n<pre class=\"lang:ps decode:true\">[Parameter(Position=0,ValueFromPipeline=$True,Mandatory=$True)]<\/pre>\n<p>Which brings me to another minor irk, an object that has a boolean value doesn't need a comparison operator. The whole point of something like an IF statement is to evaluate if the expression in the parentheses is true or not. If the object is already a boolean, there's no need.<\/p>\n<pre class=\"lang:ps decode:true\">$found = $True\r\n\r\n#bad form\r\nif ($found -eq $True) {\r\n #deleting computer from active directory\r\n #...\r\n}\r\n\r\n#better form\r\nif ($found) {\r\n #deleting computer from active directory\r\n #...\r\n}<\/pre>\n<p>I'm also not a big fan of creating custom objects with lots of Add-Member commands. I think this makes the code harder to read and doesn't really buy you much. I think using a hashtable with New-Object is much easier to read and just as effective. Plus in v3 we can now have ordered hashtables and even use [pscustomobject].<\/p>\n<pre class=\"lang:ps decode:true\">$os = Get-CimInstance -class win32_operatingsystem -ComputerName $computer\r\n$computersystem = Get-CimInstance -ClassName win32_computersystem -ComputerName $computer\r\n$is64Bit = If ($os.OSArchitecture -match \"64\") { $True } Else {$False}\r\n\r\n$Inventory = [ordered]@{\r\nComputername = $os.PSComputername\r\nOperatingSystem = $os.Caption\r\nInstalled = $os.InstallDate\r\nModel = $computersystem.Model\r\nMfg = $computersystem.Manufacturer\r\nIs64Bit = $Is64Bit\r\n}\r\n\r\n[pscustomobject]$Inventory<\/pre>\n<p>Finally, be very careful of including formatting commands in your entries, unless the event specifically calls for it. This is especially true if you are writing a function. When you include formatting directives at the end of the function, it can't be used anywhere else in a PowerShell expression.<\/p>\n<p>Don't get me wrong, there is a lot of good PowerShell which I'm happy to see:<\/p>\n<ul>\n<li>Using Join-Path to build paths<\/li>\n<li>Using Test-Path to validate<\/li>\n<li>Plenty of internal comments<\/li>\n<li>Using Test-Connection to verify computers are online<\/li>\n<li>Meaningful variable names<\/li>\n<\/ul>\n<p>So keep up the good work and on to the next event!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that the PowerShell Scripting Games for 2013 are well underway, I thought I&#8217;d share my thoughts and impressions on what I&#8217;ve seen. I&#8217;m very impressed with the number of entries and generally the quality is pretty good. But as a judge I see repeated items that bear comment. These comments are in no particular&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[534,540,425],"class_list":["post-3019","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-powershell","tag-scripting","tag-scriptinggames"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PowerShell Scripting Games 2013 Impressions &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PowerShell Scripting Games 2013 Impressions &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Now that the PowerShell Scripting Games for 2013 are well underway, I thought I&#039;d share my thoughts and impressions on what I&#039;ve seen. I&#039;m very impressed with the number of entries and generally the quality is pretty good. But as a judge I see repeated items that bear comment. These comments are in no particular...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2013-05-13T13:49:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-07-02T12:14:48+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/scriptinggames.org\/games-logo.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"PowerShell Scripting Games 2013 Impressions\",\"datePublished\":\"2013-05-13T13:49:16+00:00\",\"dateModified\":\"2013-07-02T12:14:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/\"},\"wordCount\":520,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/scriptinggames.org\\\/games-logo.png\",\"keywords\":[\"PowerShell\",\"Scripting\",\"ScriptingGames\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/\",\"name\":\"PowerShell Scripting Games 2013 Impressions &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/scriptinggames.org\\\/games-logo.png\",\"datePublished\":\"2013-05-13T13:49:16+00:00\",\"dateModified\":\"2013-07-02T12:14:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/#primaryimage\",\"url\":\"http:\\\/\\\/scriptinggames.org\\\/games-logo.png\",\"contentUrl\":\"http:\\\/\\\/scriptinggames.org\\\/games-logo.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3019\\\/powershell-scripting-games-2013-impressions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PowerShell Scripting Games 2013 Impressions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PowerShell Scripting Games 2013 Impressions &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/","og_locale":"en_US","og_type":"article","og_title":"PowerShell Scripting Games 2013 Impressions &#8226; The Lonely Administrator","og_description":"Now that the PowerShell Scripting Games for 2013 are well underway, I thought I'd share my thoughts and impressions on what I've seen. I'm very impressed with the number of entries and generally the quality is pretty good. But as a judge I see repeated items that bear comment. These comments are in no particular...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/","og_site_name":"The Lonely Administrator","article_published_time":"2013-05-13T13:49:16+00:00","article_modified_time":"2013-07-02T12:14:48+00:00","og_image":[{"url":"http:\/\/scriptinggames.org\/games-logo.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"PowerShell Scripting Games 2013 Impressions","datePublished":"2013-05-13T13:49:16+00:00","dateModified":"2013-07-02T12:14:48+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/"},"wordCount":520,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/#primaryimage"},"thumbnailUrl":"http:\/\/scriptinggames.org\/games-logo.png","keywords":["PowerShell","Scripting","ScriptingGames"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/","name":"PowerShell Scripting Games 2013 Impressions &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/#primaryimage"},"thumbnailUrl":"http:\/\/scriptinggames.org\/games-logo.png","datePublished":"2013-05-13T13:49:16+00:00","dateModified":"2013-07-02T12:14:48+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/#primaryimage","url":"http:\/\/scriptinggames.org\/games-logo.png","contentUrl":"http:\/\/scriptinggames.org\/games-logo.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3019\/powershell-scripting-games-2013-impressions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"PowerShell Scripting Games 2013 Impressions"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3722,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3722\/reflections-on-the-powershell-scripting-games\/","url_meta":{"origin":3019,"position":0},"title":"Reflections on the PowerShell Scripting Games","author":"Jeffery Hicks","date":"February 26, 2014","format":false,"excerpt":"During the most recent PowerShell Scripting Games, I was fortunate enough to be one of the judges. Now that the games have concluded I thought I'd share my reflections on the entries. Naturally these are merely my opinions but they are drawn from years of experience with PowerShell and almost\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"talkbubble","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1335,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1335\/scripting-games-2011-notes-from-the-field\/","url_meta":{"origin":3019,"position":1},"title":"Scripting Games 2011 Notes from the Field","author":"Jeffery Hicks","date":"April 11, 2011","format":false,"excerpt":"I've been making headway in reviewing and judging entries in the 2011 Scripting Games. I know there has been a lot of discussion about the lack of comments and I'm doing what I can with entries I judge, but I'm not guaranteeing anything. What I will do is put down\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2175,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2175\/try-and-catch-me-if-you-can\/","url_meta":{"origin":3019,"position":2},"title":"Try and Catch Me If You Can","author":"Jeffery Hicks","date":"April 5, 2012","format":false,"excerpt":"In looking at entries in this year's Scripting Games, as well as posts I see in PowerShell forums, I thought I'd post a short guide to properly using Try\/Catch. This is the way I think it should be used. Let's start with a Try\/Catch block that might look ok. Try\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2206,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2206\/powershell-scripting-with-validateset\/","url_meta":{"origin":3019,"position":3},"title":"PowerShell Scripting with [ValidateSet]","author":"Jeffery Hicks","date":"April 16, 2012","format":false,"excerpt":"Today we'll continue our exploration of the parameter validation attributes you can use in you PowerShell scripting. We've already looked at [ValidateRange] and [ValidateScript]. Another attribute you are likely to use is [ValidateSet()]. You can use this to verify that the parameter value belongs to a pre-defined set. To use,\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1344,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1344\/what-made-the-scripting-games-easier\/","url_meta":{"origin":3019,"position":4},"title":"What Made the Scripting Games Easier","author":"Jeffery Hicks","date":"April 14, 2011","format":false,"excerpt":"I can easily say that the quantity and caliber of script submissions in this year's Scripting Games has been amazing. I congratulate all of you on your hard work and trust it will pay off. I'd say a primary goal is education. Not only will you pick up tips from\u2026","rel":"","context":"In &quot;PowerShell ISE&quot;","block_context":{"text":"PowerShell ISE","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/04\/editorsurvey-4-300x201.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2125,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2125\/powershell-ise-addon-modulemenu\/","url_meta":{"origin":3019,"position":5},"title":"PowerShell ISE AddOn ModuleMenu","author":"Jeffery Hicks","date":"February 24, 2012","format":false,"excerpt":"Recently I did an online presentation on ISE Addons. As I was preparing for the talk one thing led to another, as they usually do when I'm working in PowerShell, and before I knew it I had a new add-on for the PowerShell ISE. This addon creates a menu for\u2026","rel":"","context":"In &quot;PowerShell ISE&quot;","block_context":{"text":"PowerShell ISE","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/02\/modulemenu-300x136.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=3019"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3019\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}