Journey to the PASS Summit 2011 – Part 7 – Day 2 Precon PowerShell

Today was PowerShell day for me at the PASS Summit. After just 3 hours of sleep last night, I did not expect too much (from myself). However, the coffee was good and the realisation of a new skill was enough to keep me going.

It’s fair to say that, although the presentation was a little disjointed, I have seen the PowerShell ‘light’ and what it is capable of. I intend to follow up this precon with a hefting helping of new blogs to read and scripts to write.

The following are some of the notes from the precon today.

What is PowerShell?

According to Wikipedia, PowerShell is a task automation framework, that consists of a command-line shell and an associated scripting language. With PowerShell, administrators can perform administrative tasks on both local and remote machines.

  • Cmdlets
    • Are specialised commands in the PowerShell environment that implement specific functions.
    • Use a verb-noun naming pattern. i.e.
      • Get-Command
      • Get-Children
    • Sets of commandlets can be combined into scripts and executables.
  • Pipeline
    • PowerShell implements a pipeline, which enables the output of one cmdlet to be ‘piped’ as an input to another; this is done using the ‘|’ character.

 

Variables in PowerShell

Variables in PowerShell are declared (using ‘$’) and set in-line. There is no need to declare them up front, or set their data/object type. The variables will take on the appropriate data/object type for the result(s) that are returned. I don’t know about you, but I think that is all kinds of awesome.

 

PowerShell Profiles

These help to load up certain modules/snapins when you load up PowerShell. This means you can port your profiles to any environment and be able to load into a familiar setup.

 

Comparison operators

Operator Description
-eq Equal to
-ieq Equal to (case-insensitive)
-ceq Equal to (case-sensitive)
-ge Greater than or Equal to
-gt Greater than
-le Less than or Equal to
-lt Less than

Logical Operators

Operator Description
-and And
-ne Not Equal to
-not Not
! Not
-or OR

more operator notes over at http://ss64.com/ps/syntax-compare.html

 

PowerShell Resources – great for those just starting out in PowerShell

Journey to the PASS Summit 2011 – Part 4 – My Pre Conference Session Picks

PASS_2011_button_180x180This is Part 4 in a series I am writing about my journey to the PASS Summit 2011. If you missed the previous entries, you can read about them here [Part 1, Part 2, Part 3]. Follow the journey on twitter with the #j2pass2011, and feel free to use the tag for your own journey!

Pre Cons!

Choosing a pre conference session for Monday/Tuesday was rather difficult. Do you choose something completely new to learn, or do you learn something new about a subject area in which you are already fairly familiar? Not to be outdone by my own questions, I chose to do one completely new subject area and one deeper dive into something I am fairly good at (but know I could be even better). Here are my picks:

It’s my belief that you can always improve the skills you already have and that’s why I’m going to Rob’s Pre-con. My T-SQL is pretty good, but I know there are areas that could do with some improvement. I hoping to get quite a bit out of this session. No pressure Rob!

I also believe that you should stretch yourself and try to learn something new every now and again. Especially when it comes to software or processes. Learning something new gives you a broader perspective and you’ll be better equipped to make the right decisions. This is why I’m taking Aaron’s Pre-con. I have only ever heard the great things about PowerShell can do. I’ll be looking to apply this new knowledge immediately for all the BI projects I work on.