Articles

PowerShell articles, tutorials, and guides from community experts.

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.

Don Jones

Tobias' Judge Notes

Tobias Weltner offers some “don’ts” from his review of Event 1 entries: http://www.powertheshell.com/scripting-games-advanced-1/

Don Jones
Scripting Games

Thoughts on Event 1 – and, frankly, a rant.

There’s been a lot of dismay floating around the community about the state of “community voting” in the Scripting Games. Some folks are voting without leaving comments (we’ve expanded the comment field to 2000 characters, hopefully that’ll help), and some disagreement about scores. Disagreement is natural. For example, stick a Write-Host in your script and I’m likely to score you lower. You may disagree, but it’s how I feel in many situations… and I’m seeing a distressing amount of it.

June Blender

How to Name Your Help Files

The first challenge of Scripting Games 2013 is complete! Honestly, you win by getting the experience of playing. I hope everyone is in there voting and writing really constructive comments. I’ll get over there in a minute, but I wanted to make sure that I got this information out to everyone before I get involved in voting. Everyone who writes shared Windows PowerShell cmdlets, functions, scripts, CIM commands, and workflows also writes help topics ““ or gets a friend or colleague to do it.

Kirk Munro

New Technical Product Manager at Provance Technologies

Today is my first day working in my new role as Technical Product Manager at Provance Technologies. A little while back Provance approached me to talk about this position, and it seemed like a very natural fit. Rarely have I felt such a positive vibe from a company through the interview process, so I was really happy to accept the position of Technical Product Manager with them and I have been looking forward to starting work with them.

Don Jones
Scripting Games

Scripting Games Voting Continues!

As of right now, we’ve got almost 1900 votes on entries in the Scripting Games. Remember that each vote is a “pointlet” (see the PowerShell tie-in we did there?), which is basically a raffle ticket in our prize lottery. But… there’s a secret about the lottery. It’s weighted based on how many entries you’ve voted on. The algorithm is a bit complex, but for example, if you’ve voted on 90% of the available entries, you’re something like 30% more likely to win a prize.

Don Jones
Scripting Games

Meet the Scripting Games Judges: June Blender

June Blender is was a senior programming writer on the Windows PowerShell team at Microsoft from Windows PowerShell 1.0 ““ 3.0. You see her work every time you type Get-Help for the core modules. She’s now working on the Windows Azure Active Directory SDK team, and she remains an avid Windows PowerShell user and a passionate user advocate. She’s a guest blogger for the Scripting Guys and she tweets Windows PowerShell tips on Twitter at @juneb_get_help.

Bartek Bielawski

Event 1: My way…

Looking for not-so-expert solution for Event 1 in both categories? Wonder how one of the judges would do it, if he had a chance? Want to return favor and tell me what I could do better and what I’m doing wrong? Don’t hesitate. 🙂 I decided it may be helpful to post my solutions before I ever see yours. Please find full article with lots of code on my blog. If you want to tell me you like/ hate this idea - please don’t hesitate either.

Richard Siddaway

CIM vs WMI cmdlets-remote execution speed

Following on from my previous post we"™ll look at how the two types of cmdlets compare for accessing remote machines. I used a similar format to the previous tests but was accessing a remote machine. First off was the WMI cmdlet ““ using DCOM to access the remote Windows 2012 server PS> 1..100 | foreach { Measure-Command -Expression{1..100 | foreach {Get-WmiObject -Class Win32_ComputerSystem -ComputerName W12SUS }} } | Measure-Object -Average TotalMilliseconds

June Blender

Name that Property

Challenge #1 of Scripting Games 2013 is coming to a close. I can’t wait to see the results! I solved both the Beginner and Advanced versions just for practice and I learned a lot along the way. They’re not easy, but if you haven’t yet tried them, go for it. And be sure to review the candidate solutions for new techniques. In my last post, I showed a very easy way to create a custom object in Windows PowerShell 3.