Articles

PowerShell articles, tutorials, and guides from community experts.

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. using double quotes (easier)
  • $ not being part of the variable name (esp with -ErrorVariable)
  • Accumulating objects in a variable and returning it, vs. outputting to the pipeline directly

What are your “gotchas?”

Don Jones
Scripting Games

Scripting Games Competitor Guide / Instructions Update

We’ve made some minor fixes and clarifications to the 2013 Scripting Games Competitors’ Guide and Instructions booklet. I encourage you to download them and review them once more before we kick off next week.
In addition, we have some additional prizes for our winners in each event - I’ve updated the prize list post to include this new information. That post, going forward, will be the authoritative prize list.
Registration is now open, and the Games will formally kick off on April 22nd. The first event opens April 25th. Please rely on the Scripting Games Home Page for a complete list of links and information, and make sure you’re watching this announcement category for breaking news. Because we are not collecting e-mail addresses, this is the best way for us to communicate with you.

Don Jones
PowerShell Summit

Pre-Summit Hang

If you’re attending the Summit and are arriving Sunday afternoon, drop by the Azteca restaurant on 148th. I’ll be there with some of the Board from 5pm, in the bar. It’s informal, pay-your-own-way, and a chance just to say hi before we kick off on Monday. Safe journey!

Don Jones
Scripting Games

[UPDATED] Scripting Games 2013 Prize List

We’ve finalized the prizes!

Overall Winners

These are the folks who do the best overall. This prize will be awarded in mid-June.
The overall winners from both the Advanced and Beginner events will win a free pass (travel expenses not included) to TechEd North America 2014 or TechEd Europe 2013 - your choice. We realize the TechEd Europe dates are pretty close to when this prize will be awarded… so we’ll try and intervene and make it a 2014 pass, if we can.
Second place overall winners will receive a SAPIEN Software Suite 2012, valued at $699, from SAPIEN Technologies.
Third place overall winners will receive 5 ebooks (per person) from Manning.

Don Jones
Announcements

Changes Coming to PowerShell.org

If you’ve been on the site today, you’ve doubtless noticed some of the visual changes. In addition to providing a simpler theme that - over time - will be more mobile-friendly, we’re also lining up for a major move of our discussion forums. That’ll probably happen after TechEd, but we may be able to squeeze it in prior.

The existing forums are fine, but they’re a bit heavy in the code department, and hard to maintain. We’ve also gotten a bit bloated with the categories. Sorry about that. Anyway, the plan is to move to an integrated forums, a simpler hierarchy, and better notification options. It’ll make it a lot easier for us moderators to help answer questions.
We’ll be archiving the old content, so it’ll still be accessible and searchable. However… and here’s the rub… we’re gonna ditch your user accounts. We have to. The old database is cloggy with spambots, and we just need to get away from it. We’re going to offer integrated login (Twitter, Facebook, LinkedIn, a bunch others), so you won’t have to entrust your password to us any longer if you don’t want to. We are not linking the old forums to this WordPress site. You’ll be creating a NEW login here, and it can use those external authentication systems. The NEW login you create HERE will be completely separate from any login you have in the existing, old forums. You don’t need to create a new account now - you can wait until the new forums go live.
Anyway… that’s all ahead. Love to hear your thoughts as we continue planning.
There’s another thing: The PowerShell People site. To be honest, that was created as a kind of… game/toy. Something to see if I could do. We’ve gotten a few people using it but not many, and it just kind of sits there on its own. We’re probably going to be spinning that down, but we’re going to take what we learned from it and try and incorporate something into this main site. No firm ideas, yet, and we’d appreciate any you may have.
In the meantime, we’ve already implemented a few changes. The new site theme is perhaps the most obvious; you’ll notice that we’ve also moved a lot of static pages - like the newsletter, Scripting Games, and Summit pages - into the new theme. We’ve also enabled single sign-on to the site, using Facebook, Twitter, Google, OpenID, WordPress.com, and Live ID (or whatever Microsoft is calling it this week).
Thanks!

Don Jones
Scripting Games

Scripting Games Instructions Now Available

I’ve posted an instruction booklet for the 2013 Scripting Games. Although you can’t register until April 22nd, you can get a sneak peek at what the new Games Web site looks like, and start preparing yourself to compete.
READ THE FRIENDLY MANUAL.
There are some one-time decisions you’ll have to make, and some “if you mess this up, you’re screwed” moments (like forgetting your password). It’s all on you - so familiarize yourself with the potential “gotchas” right away. You’re welcome to leave a comment on this post if you have any questions, or ask in the forums.
Note that the forums may not be used to ask for feedback on your entry from judges - they won’t be monitoring the forum. It should also not be used for technical support questions about the Web site; the site will have a “feedback” link on the bottom of every page for that purpose.

Richard Siddaway

PowerShell Deep Dives"“another MEAP release

Manning have released another set of chapters in their early access program for PowerShell Deep Dives.

If you have an interest in PowerShell I would strongly urge you to buy a copy. It has chapters from a number of well known PowerShell authors together with some very good material from new authors. Best of all the royalties are going to charity.

Richard Siddaway

Busy, busy, busy

A very busy time coming up in PowerShell land with the first PowerShell Summit kicking off in just over a week"™s time. The 2013 Scripting Games will also be starting very soon.

I"™ll try and post about both of them as time allows

Richard Siddaway

Creating a new disk

I really like Windows Server Core. The concept has come of age in Windows 2012.

I needed to add a new disk to a virtual machine – that"™s easy using the Hyper-V cmdlets. But what about formating the disk.

A module new to Windows 2012 & Windows can be used. Its the Storage module. I"™ve not had chance, or reason, to play with this module yet. So many cmdlets so little time.

Richard Siddaway

Windows Server Backup

Windows Server 2012 has a PowerShell enabled backup utility. When you enable the feature you get a module called WindowsServerBackup. It has the cmldets you would expect for creating and managing backups. No surprise you may say as this was avialable in Windows 2008 R2.

The difference with Windows Server 2012 is that you can do restores from PowerShell cmdlets whcih wasn"™t available in the earlier version.

The restore cmdlets are