PowerShell Pipeworks contains several functions to help you simplify interaction with SQL.
The core functions are:
- Add-SQLTable
- Get-SQLTable
- New-SQLDatabase
- Remove-SQL
- Select-SQL
- Update-SQL
The two important ones for you to remember are:
- Select-SQL, which runs SQL and unrolls each result
- Update-SQL, which takes a pipeline of objects and updates a SQL database
To show you how these work, let's create and update a simple table.
First, we need to create a new database. This example requires that you run it on a computer with SQL server