Don’t Be Afraid of PowerShellBy Lisa Szpunar
What is PowerShell?
PowerShell is Microsoft’s newish extensible scripting language and corresponding command line shell. PowerShell was specifically made for IT professionals to achieve greater productivity and control system administration more easily.
What PowerShell Can Help You Do
The thing is, PowerShell can do pretty much anything except walk your dog for you. You can even check the date and time if you really wanted to. I guess you could stop using the command line all together and do all your cmd tasks from within the PowerShell shell.
However, the real fun comes in when you can use PowerShell to make your sysadmin life easier. Here are a few random examples:
- Inventory your servers like what each has, the free memory, what service pack it is running, and so on.
- Add multiple users at once to your AD and then give them all a mailbox in Exchange.
- Back up and sync certain files then email yourself a corresponding log file…every night.
- Test out those scary commands before committing to them using the Whatif feature.
- And maybe the most compelling thing: You know how in Server 2008 R2 you can recover an AD object from the recycle bin after you have – oops – deleted it? Well you won’t find that option anywhere in the GUI. You need PowerShell to do it. If that isn’t a reason to give PowerShell a try then I don’t know what is!
For PowerShell Newbies
Good News! You don’t need any prior programming experience to use PowerShell — it is that intuitive. But, just so we are on the same page here is a short vocab lesson:
- Shell – What you the user actually interacts with. Either a command line or a GUI (graphical user interface).
- Extensible – The ability of a system to grow and change as needed.
- Scripting Language – Well, there are numerous debates going on all over creation about the difference between a programming language and a scripting language. You don’t really need to understand the specifics to understand that PowerShell is a language that you use to do administrative tasks. Who cares whether it is interpreted or compiled?
- cmdlets – Pronounced command-lets. Cmdlets are simple tools that can be used separately, but their power is realized when you combine these simple tools to perform complex tasks. Microsoft provides buckets of built-in cmdlets but you can write your own if you see fit.
For the People with Programming or Unix Experience
Not surprisingly PowerShell has all the comforts of home: man pages, aliases, wildcards, and pipelines; if statements, recursion, and loops.
If you have worked with VB or WHS then you should be able to make the translation pretty easily. There is even help for translating your existing VB scripts to PowerShell.
Top 10 PowerShell Resources to Get You Started
1. Windows PowerShell Fundamentals Training by PowerShell MVP Jeff Hicks
Windows PowerShell Fundamentals Training by PowerShell MVP Jeff Hicks, is designed for PowerShell beginners who want to understand the scripting language and get a solid foundation in PowerShell.
2. PowerCLI 101: PoweShell Basics by PowerShell MVP Hal Rottenberg
PowerCLI 101: PowerShell Basics free video training by PowerShell MVP Hal Rottenberg geared towards virtualization professionals who want to get started with PowerShell and PowerCLI, VMware’s application of PowerShell.
3. Microsoft’s PowerShell FAQ
PowerShell FAQ provided by Microsoft.
4. Professor PowerShell Column by PowerShell MVP Jeff Hicks
Professor PowerShell Jeff Hick’s educational column on MCPmag.com
5. Windows PowerShell Owners Manual
Windows PowerShell Owners Manual a free guide to getting started with PowerShell.
6. Scripting with Windows PowerShell
Scripting with Windows PowerShell a list of resources for sysadmins interested in learning about PowerShell.
7. Windows PowerShell Blog
Windows PowerShell Blog with information about the latest advancements in PowerShell.
8. Windows PowerShell Cookbook
Windows PowerShell Cookbook providing you with recipes to do specific tasks with PowerShell.
9. Windows PowerShell 2.0
Windows PowerShell 2.0 will teach you just about everything you ever wanted to know about PowerShell (and more).
10. Take Command of Server 2008 with Windows PowerShell
Take Command of Server 2008 with PowerShell — a short series of articles that provide a good introduction to PowerShell.
About the Author
Lisa Szpunar has a Bachelors of Arts in Elementary Education from the University of Iowa and a Masters of Science in Computer Science from Northern Illinois University. During her three years teaching in public schools she taught computer skills to students and peers, maintained the schools’ networks and hardware, ran the libraries, and helped to facilitate technology throughout the school district. At Train Signal Lisa manages the production of training videos, does video editing, and helps with technical support.