The Surly Admin

Father, husband, IT Pro, cancer survivor

Powershell Discovery: Variables

This is true of any programming/scripting language.  Variables are the life blood of what you do.  Without them there is really nothing you can do in a scripting language.  I’m going to assume you know all about variables so I won’t get down to what they are.  But one of the fun things about variables is all the different things you can store in them.  Objects, datetimes, integers pretty much anything can be stored in them these days.  And Powershell has a truly dizzying array of variable types to work with.  Figuring out what you’re dealing with is key to a successful script.  There are a lot of things you can do to an object, but not all objects are created equal!  So some objects will allow you to Convert them to datetime, and others won’t.  How do you find out?

Continue reading

September 25, 2012 Posted by | Powershell - Getting Started | , , , , | 3 Comments