I am currently writing some material for PowerShell beginners and it made me think about the reasons I have heard over the last few years why people don’t, can’t or won’t learn PowerShell. It’s quite interesting and share-worthy, seeing as the fundamental changes that are happening in Technology at the moment all point towards the fact that if you don’t learn PowerShell, the Microsoft platform won’t be a place you’re that comfortable in for too long. That’s a post for another day however.
From people I have spoken to in the IT community and through work, often the reason for not taking the time to learn PowerShell falls into a few categories:
- It’s too much like Unix
- I don’t trust it
- I kept seeing red text
- I don’t have the time
- I know VBScript and can work quicker with that
- We’re not sure about Security Risks it might introduce
Personally, while they might sound good, I don’t see these as valid reasons. They might justify you postponing your PowerShell education in the short term, but it will be detrimental to your career in the longer term, if you don’t want to move into an ITIL role that is. Let’s examine each of these points and see why it just shouldn’t get in your way.
It’s too much like Unix
Yes. It is. Only better. And being like Unix is not a bad thing. Chances are if you’re a Windows Admin you have very little interest in Unix, you probably chose Windows because of the GUI and Management tools, I certainly did. The Unix approach to computing has a number of benefits though – Stability, low number of exploits, reliability. Windows is evolving to take advantage of these benefits through Server Core and it won’t be long until Server Core is the standard option for a Windows Server. From Windows Server 2012 the only reason a GUI is needed on the server is for applications that do not yet support Server Core. Once application vendors catch up and no longer require a GUI on the server for their applications there will be no point in having it. No GUI means less patches, less reboots, less resources used and less reason to log onto the server. So, you’ll need to know how to administer the server in the case where the GUI tools are not available. Unfortunately, this is not a choice you can make as an admin, this is just the way technology is going to provide more value to businesses, which is what it is all about. Guess what, it’s then also made Unix that much easier to grasp, and don’t be surprised if you need to do that at some point.
I don’t Trust it
Many people, including myself, have had bad experiences in the past with things like VBScript and command prompts, sometimes you think you’re doing the right thing, run something and get a very unexpected result! Sometimes catastrophic, like rebooting all production servers rather than just one or two! Using a GUI gives you assurance, you know exactly what you’re doing and you haven’t change the wrong thing. I get that, it was a confidence thing that I struggled with when learning PowerShell. The trick is to start small and build up. Run a few small commands, get what you need, build from there. Always use the safety nets, they come in the form of –WhatIf and –Confirm parameters which can show you what the commands are actually going to do before they do it so you can verify the result, and to make sure you have to manually intervene for something to happen. They are common parameters so can be used with all cmdlets. Stick with these and you can’t go wrong. And of course, Test, Test and Test some more J
I kept seeing Red Text
This happens to everyone and it’s not a bad thing! Admins can be egotistical, seeing the red error messages is embarrassing because you as the highly intelligent Admin have got something wrong! Oh No! The red text is actually one of the best things about PowerShell and reading the error messages are the most important thing you can do. The errors are actually informative and allow you to put yourself right. Use this opportunity. Use them and you will learn from them. Don’t fear the error.
I don’t have the time
Think of it like this. How many times do you do the same repetitive task and how long does it take you? As an example, if you have to periodically re-baseline your servers or run configuration checks, how long does it take you? If you have to trawl through for certain event logs on servers periodically how long does it take you? How frequently do you need to do this?
‘Time to do Task’ x ‘Number of Machines’ x ‘Frequency over one year’ = Total Time
- Task: Collecting Machine Configuration and compiling a report
- Time to do Task: 30 mins
- Number of Machines: 100
- Frequency: 4 times per year
0.5 x 100 x 4 = 200 Hours Per Year (28 Working Days!)
Even if it takes you 40 hours to learn how to do this with PowerShell, you have still saved 22 Days of the year. How better spent is could that be?? Suddenly you have more time for projects and training. It’s attractive isn’t it?
I remember in the early days of Windows 2003, we did a monthly patching cycle like everyone else, however due to this being an enterprise environment of 1500 servers with strict SLA’s we had to log onto every server post-patching and run checks, manual visual checks to certify the results of patching. Teams of people rotated every weekend to do patching and manually check servers. How much could PowerShell have saved us back then? It’s immense.
If time is an issue, I recommend Learn PowerShell in a Month of Lunches. What could be more convenient than that?
I know VBScript and can work quicker with that
This is very common and it’s almost valid. If VBScript is working for you then that’s great, however, VBScript has not had any further development for 10 years or more and is something that will be slowly phased out. It’s a better investment to learn PowerShell sooner rather than later. Start converting some of your VBScripts. You’ll find PowerShell is quite similar only a single command may replace 10 lines of VBScript code you had to write manually. Additionally, you can then carry these new skills over to managing multiple products in a consistent way. It’s a skills investment worth making.
We’re not sure about Security and/or Risk
I’ve heard of a few companies and security teams, ok more than a few, talking about the security risks of PowerShell. Lets dispel that myth right now.
- PowerShell is secure by default. If you double-click a .ps1 file it will not execute – the default behavior is for the file to open in your local powershell editor, or failing that it will open in Notepad. To execute a script you need to do 2 things:
- Specify a ‘.\’ before the script, which tells the shell you are purposely running the script
- Set the appropriate execution policy. PowerShell has different execution policies that can control what kinds of scripts can run, for example, you can block all scripts from running, you can allow only digitally signed scripts to run or all scripts. You can control this by Group Policy and apply different settings to different users and computers. Good, right?
- You use VB Scripts in your environment. How much effort does it take to ensure malicious VBScripts are not executed in the environment? Particularly without the users knowledge.
- You have to trust your staff. I’ve heard something like “PowerShell would allow someone to accidentally or purposefully shut down all servers at the same time” and other similar comments. No one would willingly do that if they didn’t want to lose their job, and if you really think that might happen then perhaps you need to examine the sort of IT people you’re hiring.
- Cmdlets are Context Aware. While you may be able to see all of the cmdlets on a system, a user without the permissions to be able to make that change will not be able to run the cmdlet successfully. It is possible to hide certain cmdlets from users based on their permissions also, if you really wanted.
PowerShell is something that every Microsoft admin will have to get to grips with sooner rather than later as the new wave of technology comes in. It is better to start this process now than finding an excuse to put it off. The PowerShell Community is a great place to engage and start this learning process and if you’re in Singapore, I invite you to check out www.facebook.com/singaporepowershell. If you’re not in Singapore you can find your User Group at www.powershellgroup.org or through www.powershell.org. PowerShell.Org has resources for everybody so it should definitely be your first point of call for anything PowerShell.