Articles

PowerShell articles, tutorials, and guides from community experts.

Don Jones
Announcements

[UPDATED] Time is running out to own a piece of PowerShell.org

Believe it or not, we are coming up on our one year anniversary, and will be winding down our capital campaign. If you’d like to become a stockholder in PowerShell.org, you will have until June 1st May 15 to do so. Read the details at https://powershell.org/discuss/viewtopic.php?f=26&t=239 if you’re interested!
Updated to show May 15 as the cutoff date. Our shareholder meeting notices and ballots will go out on May 16, so we can’t accept new stock purchases after that date.

Richard Siddaway

Running workflows

I tripped over an interesting issue recently regarding the running of PowerShell workflows.

Consider the world"™s simplest workflow

workflow test-w1 {“hello world”}

If I run this on a 32bit Windows 8 PowerShell machine ““ it works

If I run this on Windows 2012 (64bit) on PowerShell it works

if I run this on Windows 2012 PowerShell (x86) ““ it doesn”™t work!

Be aware of how you are running your workflows

John Mello

PhillyPoSH 04/04/2013 meeting summary

  1. Jason Helmick remotely gave a demo of Sapien"™s Powershell Studio
  2. Ed Wilson, The Scripting Guy, gave a presentation on the different ways to remotely manage a Windows 8 workstation (remotely via the Charlotte PowerShell User Group)
  3. Announcements
    1. The Scripting games start on 04/25/2013, make sure to sign up! We plan on doing a post mortem once the games are done just like we did with the Winter Scripting Camp
    2. Check out the Mississippi PowerShell User, which meets virtually every 2nd Tuesday. Take a look at their schedule which is filled with great speakers.

Don Jones
Scripting Games

2013 Scripting Games Judges

As described in the 2013 Scripting Games Competitors’ Guide, our expert judges this year will not be awarded numeric scores. Frankly, folks seem more interested in having their entries peer-reviewed than just getting a number - and why not? Expert review is a great way to learn! Unfortunately, there aren’t enough judges in the world to review all the entries we’ll receive, so our judges will be picking their own “best and worst” lists, and commenting on those (taking care to not reveal authors’ names, as much as possible).

Don Jones
Scripting Games

2013 Scripting Games' Mighty Panel of Celebrity Judges

As revealed in the 2013 Scripting Games Competitors’ Guide, the 2013 Games will invite the community in general to award numeric votes for entries. Our expert judges will instead focus on commentary, helping make the Games into an even better learning experience. They’ll be commenting without revealing competitors’ names, and even if you don’t recognize your entry in their comments, you’ll hopefully find plenty to learn from.

Our top prizes, however, will be awarded by a Mighty Panel of Celebrity Judges. They’ll review all the other judges’ top picks, stack-rank them, and through some Ingenious Number Crunchingâ„¢ award the top prizes.
Bet you’d like to meet the judges.

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!

Keith Hill

PowerShell Script that Relaunches as Admin

If were following good security practices we run our Windows system with UAC enabled. This means that if you forget to launch your PowerShell prompt as Administrator when you run a script that requires administrative privilege then that script will fail.

It would be nice to build a mechanism into our script to “auto-elevate” if UAC is enabled. The trick to doing this is to run Start-Process ““verb runas. After that you only need to figure out if the current user is an administrator and if UAC is enabled. And you have to package up the script”™s parameters as an array of strings. All of this can be accomplished fairly easily with this bit of PowerShell script:

Don Jones
Scripting Games

2013 Scripting Games Schedule

Registration for the 2013 Scripting Games will begin April 22nd (check this post in case we need to make a change to that). You will register for either the Beginner or Advanced track.

Each event will kick off on a Thursday, which is when you will be able to download the event details in a PDF file. You will have until the end of the following Monday to upload your one and only entry. Please pay attention to the time zone information displayed on the Web site so that you don’t misunderstand when the event starts and stops!
The dates in this schedule refer to 00:00 hours, GMT, on the date given. So “April 25” means “00:00 hours on April 25, GMT,” or just as the clock ticks from April 24 to April 25 GMT. This is especially important for the end time - “April 30” means “as soon as it stops being April 29, GMT.”