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
Invoking SQL and read files
Executing Sql Scripts
Execute all SQL files in a Directory with Powershell
Why This SQL Server DBA is Learning Powershell
Windows PowerShell -Replace (Search and Replace)