The 2011 Scripting Games Beginner Event 1: Use PowerShell to Identify Private Builds of Software

2011 Scripting Games badge

Summary: Beginner Event 1 of the 2011 Scripting Games uses Windows PowerShell to identify private or public builds of software.

About this event



Date of Event

4/4/2011 12:01 AM

Due Date

4/11/2011 12:01 AM

Event scenario

You are the network administrator for a large multinational company with a Premier Services Contract with the Microsoft Corporation. Because of your contract, you have received a private build of a specific application that has a compatibility issue with your custom application. In preparation for your server upgrade to Service Pack 1 for Windows Server 2008 R2, your boss has asked you to identify which servers are running this private build of the application. For the purposes of this scenario, you can use the notepad.exe process. You should report the computer name, the process name (Notepad) and whether or not Notepad is a private build. You must report the actual computer name and not something generic like “localhost” because this will facilitate logging later.

The minimum requirement is code to determine if Notepad is a private build or not. Additional information in the output is not acceptable due to logging requirements. An acceptable output is shown here.

Image of command output

Design points
  • Extra points for the ability to scan more than one computer
  • Extra points for the ability to scan for programs other than Notepad
  • Extra points for reusable code

2011 Scripting Games links

2011 Scripting Games: All Links on One Page

Submit your scripts on PoshCode

Support our Sponsors!

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at, or post your questions on the Official Scripting Guys Forum. Good luck as you compete in this year’s Scripting Games. We wish you well.

Ed Wilson, Microsoft Scripting Guy

Comments (20)

  1. Anonymous says:

    @marcadamcarter omg thank you so much, not sure I would have ever figured that one out!!!!

  2. mredwilson says:

    @PHBeagle there is nothing to stop you from checking to see if the process is running, and from starting if it is not running …

  3. Neil Clinch says:

    What!  In order to get this to work on a remote computer I had to use WMI otherwise I would get

    Get-Process : Exception getting "Modules" or "FileVersion": "Feature is not supported for remote machines.".

    So I spent a lot of time on this getting it to work on a remote machine.  and all I got was two stars…you are taking points off for for me getting the extrapoints part correct?  Not fair!  I should have extra points for working on multiple process and multiple computers.

    the comment I got was:

    Steven Murawski

    4/11/2011 3:17 AM

    Functional, but check out the FileVersionInfo and the ComputerName parameters of Get-Process.


    Man I feel like smashing my Doctor Scripto

  4. @socaldavis

    Maybe this will help: Get-Process -name Notepad | % { $_.Modules | % { $_.FileVersionInfo | fl * }}

  5. mredwilson says:

    @GRebel a private build is a build of a software application that is made and not distributed to the public. It could be made for a specific customer, or it could be made and kept internal. There is a property that you can find that will tell you if the process is a private build or not.

  6. Anonymous says:

    What a whip! I hope they don't get too much harder, this one took me a good 6 hours cook up : P

  7. Anonymous says:

    For some reason, I can't for the life of me find out how to tell if an application is private build or not. I can find the build information, which shows me some numbers, but nothing that shows a true/false sort of thing. Grrrr

  8. Anonymous says:

    I'm glad I'm not the only one who has/has some issues with this one. Maybe I will not quits just yet. 🙂

  9. Anonymous says:

    The problem I see with "Get-Process" is that the process has to be running (unless I'm missing something).  Now, if you use "Get-ChildItem", then the process doesn't have to be running, but I'm not sure how to get all the details about the build.

  10. mredwilson says:

    @Gabe Rosas I do not think they will be much harder than this one. In fact, I know that several are actually easier than this one. Six hours? Great commitment! I am impressed!

  11. Anonymous says:


    You're probably like me, se we're just stressin' aiming to get the design points : -]

    I very much love this setup though – you can complete about 80% of the functionality with just light research if you're like me (green at PS). Thanks to the upcoming weekend I will definitely see this thing through.

  12. gRebel says:

    Not sure what you mean by a "private build".  Specific version of the exe?  Specific company provided it?  Can you explain better without giving the solution away?

  13. Gabe Rosas says:

    What a whip! I hope they don't get too much harder, this one took me a good 6 hours cook up : P

  14. Martin says:

    While I managed to do this on my local computer I have not found a solution to scan over the network. At least the most obvious way does not work for this property. And I think that some other ways are probably too complicated for a "beginner" task (e.g. as they need PS and specific configuration on the remote system).

    Could you please confirm that there is a (simple) solution for this? Thank you.

  15. CSeiter says:

    Started it Monday after lunch; just got done with it today.  The "Windows PowerShell 2 For Dummies" book apparently did not have me in mind.

  16. cseiter says:

    after uploading I caught a typo from me having multiple versions while working on it.  I put the correction in the comment field since I got the "can only upload 1 script per event" error.

  17. Peter says:

    Had a bear of a time getting the private build information from a remote server. Can't wait to see a more official version of this script. Mine works, but didn't take the time to run against sets or processes/computers. That would have made me feel better. However, at least it's finally submitted and I can expect at least 1 star for the submission. 🙂

    I agree with you, Gabe. If these get much harder, I think I'll be approaching the "throw in the towel" phase. I'm definitely more of a DB guy than a script monkey.

    @Martin – there are ways of getting it to work over the network, though it definitely took me a while to find it. May want to check WMI possibilities. I cannot confirm that there's a simple solution to it, though. I'm guessing some of the people playing this as "golf" (write a script with as few lines as possible) probably have a one-liner, but I know that was not me.

  18. Ugh says:

    know I am making it MUCH more complicated than it needs to be. The beauty pw PS is that very little with do a lot. I tend to get really inviolved and have it check this and that. My problem was getting all three of the pieces from the get-process. I can find bits and pieces elsewhere. I'd hat to see what the advanced game is lke!!!

    I several times came close to throwing in the towel. But I figure my scripts may be a lot bulkier than they need to be and i am doing more than what is required BUT I am learning more and more and thats all that matter right. well and if I can pick up a copy of primalscript i'd be happy. Or maybe ed shouod give us all in the beginner events a signed copy of his book!? LOL

  19. Geekcroft says:

    @PHBeagle – thats the route I went down – I then piped it into a Select-Object to get the properties I required 🙂 (and if your clever and build the path to notepad in UNC format, it will take remote computer names easily too)

    Anyone know when the official answers for 1 come out?

Skip to main content