Powershell Automation. Why PowerShell ?


 
 
Get-PowerShell | Use-PowerShell -Force




     Companies usually use lots of diverse equipment : Servers, PCs, printers, communication devices...

     And usually have personnel to manage them, and probably even some training.
 
    But strangely enough, even when having the hardware, most processes are run manually : mouse, click, cut, paste, edit...

    Even the most critical ones, the ones requiring more time, the ones done at out-of-office times.

    Have you ever had the feeling you're losing your valuable time by doing a repetitive task ? To be tied to the computer ? Have you seen a full department dedicated to just cutting and pasting ?


     Computers, and not humans, should automate the tasks !
 
     What are we thinking about ? Not productivity, of course !

    Have we ever stopped to think there are better ways to work ?
   

My company does not automate...

   The Windows environment has created generations of "mouse administrators", who know all those "but-it-is-very-easy" operations, using click & drag & drop...  Ask them a task, they will run to get the mouse... without stopping to think about better options.

    ... but when they need to repeat a task multiple times, this procedure is highly inefficient, and highly unreliable.

     How many times have we deleted a complete OU or a folder by mistake ? How many times did we have to work overtime, copying and pasting the same data ? How many times did we forget an important step, or did it in the wrong order ? How many times did you have to start again a full process, because you didn't get a coherent result because some other people did it in different ways ?

     IT is a science. Computers have to work for humans, and not the opposite.

Automation and Scripting are the way to make sure this works. The results will be coherent, predictable, reliable, and cheaper. A script will never forget any important step, even at midnight. And a script self-documents the process for other administrators...

 


Automation Advantages


There's a number of advantages; some more evident, some mure subtle, that will be observed with time.

 

1. The first one is evident. Automation makes us more profitable.

   The cost reduction provided by automation allows performing more tasks, in more environments, with less resources, in less time... and with a bigger reliability.

   Any process which gets done more quickly, in a more reliable way, error-free... will considerably reduce our Total Cost of Operation.

   If most of our daily processes are scripted, the savings will be more evident, and immediately noticeable.

   Students, even in the Introduction Course, have noticed this immediately : since the first day they start automating real tasks.

    

2. It is mandatory.  Microsoft has drastically changed its approach.

    The GUI does not scale well. Automation is needed for every task.

     Microsoft has decided that Windows and all server products must be compulsorily managed by PowerShell.

     Many options are not reachable from the graphical interface (GUI)... and they will never be.

     Besides, the old commands like IPCONFIG, PING, TRACERT, NETSTAT...  will soon be obsolete and unsupported ! You must learn their PowerShell equivalent.

 

3. Scalability

   An scripted process will require the same resources when you run it in a couple of computers... or in hundreds of them. And with the same reliability.

 

4. We can become more competitive.

    A company able to react to changes in a scripted way will have a bigger competitive advantage.

    Some countries or companies are more delayed in their scripting approach than others...

    Under a personal point of view, an employee who knows how to automate processes is much more profitable than one who does not.

 

5. More efficiency, reliability, predictability

    Automation makes us work in a more strict way, more professional, avoiding risks, doubts, errors... even when working at night and under pressure.

    This is what every company requires : avoiding costly errors, unplanned tasks, improvisation, forgetfulness...

   A script won't make mistakes or forget any step ! 

 

6. More productivity, but a better worklife balance at the same time.

   A routinary process which gets executed automatically will free time for more productive or satisfactory tasks.

    The implicit satisfaction associated to creative tasks, and avoiding routine tasks, provides a huge long-term value. Dedicating all your time to troubleshoot problems creates burn-out !

 

7. Coherence.

    A scripted task will yield a coherent result. A task run by several humans will always show differences.

 

8. Professionalism.

    IT should not be a set of "Cowboy Jobs" or constant improvisation, but follow an Engineering approach. Scripting enforces this professional approach : Planning, Testing, Improving, Documenting.

 

9. Immediate Return of Investment (ROI)

    As your skills evolve, you will be able to automate more complicated tasks.

    But PowerShell proves to be useful in saving time and resources from the immediate beginning.

 

10.  Some additional reasons :

 

 

















(Extracted from course "Exhaustive PowerShell")

 

 


 DevOps - the last trendy fashion ?


    We can recently hear many words about DevOps ... but what is it ? 

    Since its beginning, IT has suffered a strong role segmentation, imposed by IBM since the '50s. There were Analysts, Programmers, Operators... but as separate roles, one person could perform only one of these tasks.

    In the XXI century, this segmentation has slightly evolved, but is still maintained : our company hires programmers (who write the applications or tools, in their ideal development environment), and administrators : people in charge of system operation (System Administrators and the like).

    Both groups work in different environments, with different permissions, problems and objectives... and only at some times they must meet and agree. But, generally speaking, an administrator does not know how to write a single line of code, and a developer is not aware of the real problems to distribute his own application to 17000 computers in the company.

    DevOps is a new philosophy. During all the software lifecycle, it will try to put togeher both extremes. That means (amongst many other things) that you'll need people who know about operation and administration, but who already know about development. Or, said in the opposite order, people who know how to write code, but who also know about operations and their scenarios and problems. That is, the best of both worlds.

  PowerShell is the perfect starting point. The future goes in this direction : Windows, System Center and other products are starting to require DevOps profiles...

 


 I already know some PowerShell... for sure ?


    Then it's the time to learn deeper. If you already used PowerShell in a real environment, its advantages will be evident, and learning on more advanced possibilities will provide an immediate benefit.

      But before moving on, one consideration. In my training experience, I've found many students who had learnt something about PowerShell, have compared it to other languages... but they didn't understand the philosophy behind it. PowerShell seems very similar to other scripting languages, but offers some radical philosophical differences.

      If you don't get the right principles from the beginning, you'll write mediocre scripts ... mere translatons from VBS... or even worse, scripts with subtle but dangerous problems.

 

 

    Formal training will help you quickly understand the concepts, avoid the common pitfalls, and save lots of time.

     And also, acquire and reuse ideas and practical experiences from other teams and environments. And of course, value the excellence when creating scripts.

      If you'd like to review some of these concepts, I've created some test examples. All of them are wrong.  You can check them here :

Common Errors

     Provide honest answers, that info is just for you. If you believe the examples are right or have doubts on the answers, then your scripts will fail in some situations. You'll need some training on the concepts.

  


PowerShell is useless...


  

  Unless you can find a good usage for it.

  PowerShell is just a tool, a huge collection of possibilities to use. Only when you find a practical usage it will shine !

  Some ideas :

      Of course, there are thousands of practical usages, which will show up while creating other scripts. Experience provides ideas !

       And ideas provide code which can be reused later. Building scripts in PowerShell is faster than it seems, if you follow the recommended best practices, and avoid the "black holes".

 

 

 


Learn PowerShell before it's too late ! 


Some additional links :


http://www.microsoft.com/powershell

http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx 

My articles in LinkedIn : The Need For Automation and Why PowerShell ?

 By the way, the Spanish Press is already talking about the need of learning PowerShell ! http://labanguardia.com  (in Spanish, and in a humorous mood)

 

 

Get-JC © December 2015
All Rights Reserved.

Get-PowerShell | Use-PowerShell -Force

 www.powershelltraining.eu