Articles

PowerShell articles, tutorials, and guides from community experts.

Don Jones
PowerShell for Admins

How Cloud-First Design Affects You

Today, Brad Anderson (Corporate VP in the Windows Server/System Center unit) posted the first in what should be a series of “What’s New in 2012 R2” articles. In it, Anderson focuses on how Microsoft squeezed so many features into the 2012R2 release in such a short period of time. The short answer, which has been stated by Jeffrey Snover before, is “we build for the cloud first.” That means features we’re getting in 2012R2 have, for the most part, already been developed, deployed, and in use in some of Microsoft’s own cloud services.

Don Jones
Announcements

It's Safe to Run Update-Help – and you should!

I’m informed that sometime today Microsoft will be posting fixed core cmdlet help files for your downloading pleasure - so it’s safe to run Update-Help again, and you should definitely do so. There are likely a lot of fixes and improvements to the help text, and you won’t be “losing” the parameter value type information from the SYNTAX section. Maybe schedule an Update-Help for tomorrow morning? BTW - kudos to the team at Microsoft for getting this issue fixed so quickly.

Don Jones

PowerShell Great Debate: Formatting Constructs

Here’s an easy, low-stakes debate: How do you like to format your scripting constructs? And, more importantly, why do you like your method? For example, I tend to do this: `If ($this -eq $that) { do this } else { do this } `I do so out of long habit with C-like syntax, and because when I’m teaching this helps me keep more information on the screen. However, some folks prefer this:

Don Jones
Announcements

Come to PowerShell Summer School!

Through my company Concentrated Tech, I’ve decided to run a set of three PowerShell Summer School classes (click that link for descriptions). These will be a combo of self-study and weekly online sessions, designed to teach Toolmaking, Practical applications of PowerShell, or how to teach PowerShell in a lunch ’n’ learn style format. Registration is open from now until August 1st, and you’ll also get a discount on some great SAPIEN products to use during class, if you like.

Don Jones
Announcements

Seeking Editor for PowerShell.org TechLetter

The PowerShell.org TechLetter goes out once a month, and we’re looking for an editor to take over the task of building each monthly issue. You’ll need some basic HTML knowledge, and ideally will have a decent HTML editor. Not FrontPage. You’ll be given articles in both HTML and Word format, and will need to insert those into a master HTML document and (especially in the case of Word), fix the formatting.

Don Jones
Announcements

[UPDATE: It's Safe] CAUTION: Don't Run Update-Help Right Now

UPDATE 2 JULY 2013: Microsoft is informing MVPs that the fix is in, and new help files should be downloadable by (at latest) the morning of 3 July 2013. So get your Update-Help ready to run. More info. If you haven’t recently run Update-Help… don’t. There’s a problem with the help files that have been produced recently so that instead of: **-computername ** You’re getting: -computername This affects all parameters - no value types will be shown.

Don Jones

PowerShell Great Debate: To Accelerate, or Not?

At his Birds of a feather session at TechEd 2013, Glenn Sizemore and I briefly debated something that I’d like to make the topic of today’s Great Debate. It has to do with how you create new, custom objects. For example, one approach - which I used to favor, but now think is too long-form: $obj = New-Object -Type PSObject $obj | Add-Member NoteProperty Foo $bar $obj | Add-Member NoteProperty This $that We saw some variants in The Scripting Games, including this one:

Don Jones
PowerShell for Admins

Pipeline or Script? That is the Question

When I teach PowerShell classes, I often start by assuring students that, with the shell, you can _accomplish a great deal without ever writing a script. _And it’s true - you can. Unlike predecessor technologies like VBScript, PowerShell lets you pack a lot of goodness into a one-liner - or even into several lines run manually in the console. What I never say is _you can accomplish anything without ever writing a script.

Don Jones

PowerShell Great Debate: Capturing Errors

Hot on the heels of our last Great Debate, let’s take the discussion to the next logical step and talk about how you like to capture errors when they occur. The first technique is to use -ErrorVariable: `Try { Get-WmiObject Win32_BIOS -comp nothing -ea stop -ev mine } Catch { use $mine for error } `Another is to use the $Error collection: `Try { Get-WmiObject Win32_BIOS -comp badname -ea stop } Catch {