PowerShell powers automating different tasks and Windows PowerShell is the Microsoft’s task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems.
Following links will be useful when dealing with PowerShell
PowerShell Tutorials – Variables
http://www.powershellpro.com/powershell-tutorial-introduction/variables-arrays-hashes/
Invoking SQL and read files
http://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_24152261.html
Executing Sql Scripts
http://www.vistax64.com/powershell/190352-executing-sql-queries-powershell.html
Execute all SQL files in a Directory with Powershell
http://www.sqlfeatherandquill.com/2011/01/10/how-to-execute-all-sql-files-in-a-directory-with-powershell/
Why This SQL Server DBA is Learning Powershell
http://www.simple-talk.com/sql/database-administration/why-this-sql-server-dba-is-learning-powershell/
Windows PowerShell -Replace (Search and Replace)
http://www.computerperformance.co.uk/powershell/powershell_replace.htm