I’m seeing a lot of scripts where code is used to perform an action that is available as a parameter on a cmdlet that is used earlier in the pipeline.
Read the help file for the cmdlets you are going to use to see how you can get PowerShell to do the work for you instead you having to create and test code
Is there a difference between scripting and automation. According to Dan http://blogs.msdn.com/dtjones/archive/2008/11/23/scripting-dba-actions.aspx the answer is yes. Scripting means you perform a task programmatically using a scripting language (PowerShell I hope). Automation means that the script is automatically initiated as a scheduled task or a SQL Server job etc.
A quick search shows a number of definitions for automation:
"The replacement of manual operations by computerized methods."
"The automatic operation or control of equipment, a process, or a system."
"a system in which a workplace or process has been converted to one that replaces or minimizes human labor with mechanical or electronic equipment"
I would argue that there is a spectrum of activity ranging over:
- perform task manually (GUI or command line)
- script task
- run script automatically
Creating 7000 users and mailboxes in AD\Exchange is something you would do with a script. Would you have that script automatically initiated - I don't think so. But I would argue that you are still automating that task. The machine is doing the work - quicker and potentially (hopefully) more accurately.
My stance is that scripting is automation and whether you run the script manually or automatically in response to a task you are still automating.
There are some useful guidelines on scripting in the post that are applicable to any language.