Writing a script to accomplish a task can be a daunting process. For those of us that are administrators without any programming background, it might not be straightforward to even know where to start.
For very simple tasks, it might be possible to write the entire script in a single line-by-line flow. While this is possible for the shortest tasks, as we get more comfortable with scripting we will definitely be applying PowerShell to more complex problems. Writing complex scripts in a simple start-to-finish way is bound to cause difficulties. In the following sections, we will give some basic instruction on how to go from an idea to a workable script. We will use the task of copying a production database down to a development server as an example.