Articles

PowerShell articles, tutorials, and guides from community experts.

Don Jones
Announcements

The New Look of the Scripting Games

I’ve been busily working on a new interface for the Scripting Games - we’re still planning a Winter Games event - and wanted to share progress. You can click this thumbnail to see the full image. The new Scripting Games features movable, resizable panes The new layout features movable, resizable panels, allowing you to position them however works best on your screen. No, they’re not especially mobile-friendly. As you can see (at least in implication), entries can consist of multiple files, as in a complex script module.

Don Jones
Announcements

Seeking Curators for PowerShell eBooks

[UPDATE: I think I’ve finally gotten all the books under curation - but if you’ve an idea for a PowerShell-related ebook, and would like to co-author or even be a principal author (I’ll help out with logistics), still hit me up.] As you may know, PowerShell.org hosts a number of free ebooks that have, to date, been written mainly by me. But I’ve recently been delighted to welcome some co-contributors - Forums regular Dave Wyatt has contributed new content to “Secrets of PowerShell Remoting,” for example, and Matt Penny has volunteered to organize the forthcoming “Community Book of PowerShell Practices.

Don Jones
Announcements

Nominate Your PowerShell Hero

PowerShell.org is proud to announce a new community recognition program: PowerShell Heroes. We’re looking for your Hero nominations! A PowerShell Hero is someone who you feel does an outstanding job helping the community, perhaps by answering questions in forums (here or elsewhere), writing useful blog posts, offering education, and more. A PowerShell Hero is someone who has not already received formal recognition elsewhere , meaning past and present MVPs are not eligible.

Don Jones
Scripting Games

Winter Scripting Games: More Feedback Needed

So I’m continuing to work through some logistics regarding the Winter Scripting Games (and no, there’s no dates set). The intent of these Games, as I’ve written before, is to offer a collaborative experience. You’ll work in teams of (proposed) 2-6. You have two ways to join a team: Pick an existing one that needs players (you’ll be shown the average time zone offset, in minutes, of the existing players, so that you can choose a team near you) or create a new team from scratch - which others can then join.

Don Jones
Training

My New PowerShell Video Series, Covering v2/v3/v4, Launches

It’s finally starting to be published - my Ultimate PowerShell Video Training Series, covering versions 2 and onward. This series will initially consist of 90 chunks of roughly 20 minutes each, adding up to more than 30 hours total. I’m building each individual video to CLEARLY differentiate between PowerShell v2, v3, and v4; for the most part, I switch to Windows 7, Windows 8, and Windows 8.1 to demonstrate specifics in each version.

Don Jones
Books

Great Debate: The Conclusion

All this Summer, we’ve been encouraging your feedback in a series of Great Debate posts. Most of the topics came from the 2013 Scripting Games, where we definitely saw people coming down on both sides of these topics. My goal was to pull everyone’s thoughts together into a kind of community consensus, and to offer a living book of community-accepted practices for PowerShell. This’ll be a neverending story, likely adapting and growing to include more topics as the years wind on.

John Mello

PhillyPoSH 09/05/2013 meeting summary

Author, Scripting Games 2013 winner, and founder of the Mississippi PowerShell User Group, Mike Robbins, gave a presentation entitled “Using CIM Cmdlets and CIM Sessions” via Lync. Afterwards various group members participated in script and tell. A recording of the meeting is available on our YouTube channel, please note that half way through our script club we had an issue with a duplicate audio track.

Don Jones
Training

Writing Courseware: 10961 PowerShell Class

We’re in the process of working on a 10961C revision to the Microsoft PowerShell course, and I’ve been reviewing the anonymous comments submitted by MCTs and students on 10961A (the “B” rev, which is what was produced after our beta teach, is just now orderable so we don’t have comments yet). **By the way - if you’re a student or MCT who has taken/delivered 10961A, you’re welcome to contact me directly if you want to share any info on typos you found.

Don Jones
PowerShell for Admins

Regular Expressions are a -replace's best friend

Are you familiar with PowerShell’s -replace operator? "John Jones" -replace "Jones","Smith" Most folks are aware of it, and rely on it for straightforward string replacements like this one. But not very many people know that -replace also does some amazing stuff using regular expressions. "192.168.15.12,192.168.22.8" -replace "\.\d{2}\.","10" That’d change the input string to “192.168.10.12,192.168.10.8,” replacing all occurrences of two digits, between periods, to 10. The 12 would be skipped because it isn’t followed by a period, as specified in the pattern.

Don Jones

PowerShell Great Debate: "Fixing" Output

When should a script (or more likely, function) output raw data, and when should it “massage” its output? The classic example is something like disk space. You’re querying WMI, and it’s giving you disk space in bytes. Nobody cares about bytes. Should your function output bytes anyway, or output megabytes or gigabytes? If you output raw data, how would you expect a user to get a more-useful version? Would you expect someone running your command to use Select-Object on their own to do the math, or would you perhaps provide a default formatting view (a la what Get-Process does) that manages the math?