Working with Windows Powershell 3.0 at Microsoft Virtual Academy

Microsoft Windows Powershell 3.0 IconHaving a heavy Linux background since 2010 I have been one of those users who hated Microsoft Windows “shell”. Until recently when I found an awesome free online resource to start learning Windows Powershell 3.0. Since my IT job basically focuses on Microsoft Products, I decided to give the Microsoft Virtual Academy a try as well as Powershell. The Microsoft Virtual Academy or MVA for short is an awesome free resource to learn more about Windows products. Having an explanation from the inside guys at Microsoft can help you learn how to be more productive and gain an intimate understanding of the software. Because of MVA, I have learned just how great Windows Powershell 3.0 really is. The explanation provided by the presenters of how and why certain items of Powershell work the way Powershell does made the connection I was missing just click.

Changing the way you think of a shell seems to be Windows Powershell’s main goal. When I think of a Unix shell, I tend to think of text. Which is mostly what you are working with from a Unix shell. In Windows Powershell, Microsoft wants you to think outside of strings, and look more at actual objects for an Object Oriented approach. The Object Oriented approach allows for a whole array of new utilities without much hackery needed. For example, when you want to pull a list of processes sort it t by memory usage and only grab processes using memory in a certain range and sort it by name, the code is simply:

Get-Process | Where {$_.WorkingSet -lt 900000 -and $_.WorkingSet -gt 400000} |
 Sort name
									

As opposed to Unix / Linux you would first have to grab the text as a string then sed and awk it with some *nix voodoo to get the data you wanted. This is probably one of my favorite features about Windows Powershell 3.0. I was never a great at using sed and awk and always spent way too much time trying to figure out how to get exactly the data I wanted.

I would hate to be viewed as a Microsoft fanboy as I really am not; however, I am now a Windows Powershell 3.0 fanboy. The common sense approach Microsoft took to Powershell 3.0 really just makes sense to me. I enjoy working with Powershell 3.0 and am very glad I decided to better myself by working with a wider range of utilities, instead of just sticking to Linux / Unix. To date, I have written at least 5 Powershell 3.0 scripts that have increased my productivity and made tedious tasks a lot more manageable. For me, as long as there are quality free resources to help me understand and work with different utilities, I plan to use them to my benefit.

tl;dr If you have wanted to try out Powershell 3.0 but have been too overwhelmed with the learning curve, there is no better time than now. Even if you hate(d) Powershell because it “is” not a real shell, I highly suggest to head on over to Microsoft Virtual Academy and check out the Powershell 3.0 series and see if your mind changes. I know mine did. So stay tuned for my adventures into the more advanced sections of Microsoft Windows.

2 Comments

Leave us a comment

  • acd
    on

    I’m really impressed with what you were able to do with powershell in such a little amount of time (only a week or two, right?). It gives me a lot of hope for running win2012 headless with a useable remote console. Have you been able to get ssh-to-powershell wired up? I’m thinking about spinning up a server ’12 tonight in a vm.

    • Jim
      on

      It has been more like 7 days at most, but I also have a heavy scripting background with PHP and other languages (C# / VB .Net), so really what the series did was provide me with the syntax and the way Powershell was written. With those, I have been able to really figure out most of what I am wanting to do and write scripts up. It also helps that it really is a common sense approach to a shell. Perhaps my favorite part about Powershell is that Powershell just makes sense.

Leave a Comment

↑ BACK TO THE TOP ↑