About

I’m a husband, a father, an environmentalist, and a Product Manager.  When I was 10 years old when my dad brought home a TRS-80 computer and I started developing an interest in programming.  That really dates me, doesn’t it?  There was something about the power of those one-liners in Compute! magazine that really got my attention back then.  Little did I know then that I was starting down the road towards my future career.  Years later I went to university, earned a Bachelor’s Degree in Computer Science,  and then worked first as a software developer and later an architect for 13 years.  During the last few years in my role as software developer and architect I became more interested in the big picture and driving the direction of software than actually creating it and now I work as a Product Manager allowing me to do just that.

I’m very passionate about very few things.  For many years this list has only included my family, anything green, and the user experience.  In early 2007, PowerShell started taking a very prominent place on that list, so much so that I decided to completely redirect my career towards it.  I worked as a member of the PowerGUI® team at Quest Software from late 2007 until mid 2011, and these days I work as Product Manager for PowerWF™ and PowerSE at Devfarm Software.  In recognition for my contributions to the PowerShell community during this time I have received the Microsoft MVP award in the Windows PowerShell category in 2008, 2009, 2010 and 2011.

My personal motto is: “Do better, in everything that you do”.

If you want to contact me, leave me a note in the comments or use the form on my contact me page.

Kirk Munro

  1. October 18, 2007 at 2:28 pm

    Hey! Are you Canadian?

    Marco

    Like

  2. October 18, 2007 at 2:59 pm

    I am Canadian! Living in Ottawa, Ontario at the moment, but I was born a Maritimer and spent most of my life in the Halifax /Dartmouth area.

    Like

  3. November 27, 2007 at 12:04 am

    Hello,
    Nothing whatsoever to do with PowerShell except that at the seminar recently at OWSUG there were, in your exposition, many references to JK Rowling characters. My preference would be for HDM by Philip Pullman. This trilogy is, for me, better written and my 11 year old read the whole lot, which was a wonder. Better still, now that the first volume has been filmed, the Church is wanting the books removed from libraries. This in Ontario. Hollow laughter, but congratulations for an interesting evening.

    Like

  4. arnaud
    January 4, 2011 at 1:08 pm

    hi

    i use function New-LocalUser from your Network.powerpack. Very nice code !!

    however, when i call it, the first parameter which is a string array of users ( i think), has the value “A,””,FullName 102,description 102, ,”False” ,”False” ,”True”, “False”, @(“RDN5V197″), $null”, corresponding to all the parameters.

    i call it with the following way :

    $password = “mypassword” -asSecureString
    $tempCredential = New-Object System.Management.Automation.PsCredential “administrateur”,$password
    $password = $tempCredential.GetNetworkCredential().Password

    New-LocalUser @(“A”),”passwordUser” , “FullName 102″, “description 102″ ,”False” ,”False” ,”True”, “False”, @(“RDN5V197″), $tempCredential

    is it possible for you to answer me with an exemple call of this function ?

    Like

    • Kirk Munro
      January 5, 2011 at 9:07 am

      Hi Arnaud,

      The reason your parameters are being treated as part of the array is because of the commas you use between them. In many programming languages, commas are used to separate parameters in function calls. This is not the case for PowerShell. You can separate parameters with spaces, or you can pass in the parameters by name. Also switch parameters are not the same as boolean parameters. If you want them, you include the switch. If you don’t, you simply leave it out. For the New-LocalUser function, with the values you have specified, you would do this:

      $password = ConvertTo-SecureString -String passwordUser -AsPlainText -Force
      New-LocalUser -Name @(‘A’) -Password $password -FullName ‘FullName 102′ -Description ‘Description 102′ -PasswordNeverExpires -ComputerName @(‘RDN5V197′) -Credential administrateur

      This will prompt you for a password for your administrateur account when you run it. If you don’t want the prompt, you could replace administrateur with $TempCredential as you have in your example script.

      I hope this helps. Let me know if you have any additional questions.

      Kirk out.

      Like

  5. arnaud
    January 10, 2011 at 4:08 am

    hello,

    many thanks

    Another question. I tried the error handler with the try catch block. if we have 2 command in the try block,and the first command in try generates an error, process execute the block catch but execute after the 2 command.

    Should there be a specific process to go into catch block and not execute next command in block try?

    try{

    command 1
    command 2

    }catch{
    write host …

    }

    Like

    • Kirk Munro
      January 10, 2011 at 9:35 am

      You need to be aware that there are two types of errors in PowerShell: terminating errors and non-terminating errors.

      Terminating errors are errors that result in an exception being raised. When an exception is raised the current script block will immediately stop. Those errors are the kinds of errors that are caught using the catch part of the try/catch statement. An example of a terminating error is if you divide by something by 0. i.e. if you run this script block:


      {
      1 / (1-1)
      'This will never execute'
      }

      you will never see the ‘This will never execute’ string because the script terminates when it attempts to divide a value by zero.

      Non-terminating errors are errors that do not cause a script to terminate. These types of errors are not catchable using try/catch statements unless you specifically tell PowerShell that you want them to be treated as terminating errors. For example, consider this script block:


      {
      Get-Command -Invalid Value
      'Hello'
      }

      If you did not want the second command to execute if the first command returns an error you would either have to add “-ErrorAction Stop” to the end of the first command (instructing PowerShell to treat errors from that command as terminating errors) or you would have to insert “$ErrorActionPreference = ‘Stop'” before the first command (instructing PowerShell to treat all errors in that script block as terminating errors). Either of these will allow you to catch those errors in the catch portion of your try/catch statement. The only other alternative is to specifically check to see if a command raised an error or not, like this:


      {
      Get-Command -Invalid Value
      if ($?) {
      'Hello'
      }
      }

      Hope this helps.

      Like

  6. arnaud
    January 11, 2011 at 4:18 am

    superb !

    Like

  1. April 30, 2008 at 6:22 pm
  2. May 3, 2008 at 1:40 am
  3. November 16, 2008 at 2:14 pm
  4. December 19, 2008 at 5:41 pm
  5. February 1, 2009 at 11:55 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 281 other followers

%d bloggers like this: