PowerShell for Admins

PowerShell for Admins
ScriptingWife
PowerShell for Admins

Charlotte User Group July Meeting

Please join us on a special date in July. This month our meeting will be on July 11, 2013 instead of our normal first Thursday of the month due to the holiday. Microsoft Scripting Guy Ed Wilson will make a presentation on DSC Desired State Configuration for PowerShell V4. Sign up at the following link in Meetup so we know how many will be there and we can have adequate food for all.

Don Jones
PowerShell for Admins

Meet the Scripting Games Judges: Olver Lipkau

I have been working for AtoS, formaly Siemens IT Solutions and Services, for 6 years as a IT Consultant. I was 15 when I started scripting. First only batch scripts to automate simple things. With time the scriptt grew in complexity and languages. VBS, AutoIt, AHK and finally PowerShell, which superseeded all others. PowerShell became a passion and became more and more a daily thing. I was invited to be a judge for the Scripting Games in 2011, 2012 and now 2013.

Art Beane
PowerShell for Admins

Some notes on Event 2 Advanced

I hate to seem negative, but I’ve noticed a few things about a number of the advanced entries that seem like folks didn’t read the instructions, or just weren’t careful about details. There were a surprising number of entries that had [string]$ComputerName instead of [string[]]$ComputerName in the params section and then went on to treat the parameter as if it were an array. Somewhat related to the array issue, the problem statement indicated that there could be several files that had computer identification for piping into the solution.

Art Beane
PowerShell for Admins

Notes on Beginner Event 2

 First of all, congratulations! It looks to me like a lot of learning is going on; the 2nd event entries look really good to me. I especially liked the way a number of you built up a one-liner by starting with a_ Get-WmiObject Win32_ComputerSystem -ComputerName (Get-Content file.txt)_ and piping it into Select-Object to generate the data. However, there were a couple of areas within the Select block that make me think that some more discussion of what $_ means in a pipeline would be helpful.

June Blender
PowerShell for Admins

Placing Comment-Based Help

What an amazing event. I’m now reading through each of the Advanced entries in a vain attempt to whittle the entries down to a short list. It’s an incredibly difficult task, which is testament to your skill and diligence. We are so lucky to have so many competent scripters in the community. As I read through the comments on each script, I’ve noticed several that say: “Help should be nested under the function to work properly.

Art Beane
PowerShell for Admins

Judge Notes for Event 1

 A lot of you have been working too hard at solving the problem (both beginner and advanced). Some of this is clearly related to trying to offer a very complete solution but some look like attempts to write extra clever or elegant code. In the “real world”, there"™s probably not enough time or interest in putting lots of effort into these extras. The minimum it takes to achieve the goal is most often good enough.

Don Jones
PowerShell for Admins

Why Doesn't My ValidateScript() work correctly?

I’ve received a few comments from folks after my observations on the Scripting Games Event 1. In those observations, I noted how much I loved: [ValidateScript({Test-Path $_})][string]$path As a way of testing to make sure your -Path parameter got a valid value, I love this. I’d never thought of it, and I plan to use it in classes. I may write a book about it someday, or maybe even an ode.

Enrique Puig
PowerShell for Admins

Comparing SQL Server table schemas with PowerShell

As a SQL Server DBA or SQL Server developer sometimes is necessary to know whether two tables have equal schemas or not. For example, a few months ago I had to consolidate two SQL Server instances in just one. One of the main problems were the collisions between Databases and Tables. I found out that both instances had Databases with equal name and the same thing happened with tables inside those databases.

Don Jones
PowerShell for Admins

What are Your PowerShell Newbie Gotchas?

I’m putting together a list of common “gotchas” for PowerShell, mainly things that affect newcomers. So far, I’ve got: Piping the output of a Format cmdlet to nearly anything else Using -contains instead of -like Selecting a subset of object properties and then trying to sort/fiter on a now-missing property Wrong syntax for -filter parameters on various commands Commands that don’t produce pipeline output (e.g., piping Export-CSV to something) Using ConvertTo-HTML without -Fragment and appending multiple pages in one file Confusion with ( [ { and the other punctuation Concatenating strings (hard) vs.

Don Jones
PowerShell for Admins

Coming: Tips for the Scripting Games

In preparation for the upcoming Scripting Games, the April 2013 issue of the free PowerShell.org TechLetter will feature tips, examples, and advice for helping you do the best in the Games! Remember that the Competitor Guide is now available, so you can start reviewing how the Games will be graded (by the community) and judged this year. If you’re not already receiving the TechLetter, [subscribe by April 15th][3] to receive the April issue in your Inbox!