SQL Server via PowerShell
There are several ways to work with SQL Server via PowerShell. The way you choose to work will largely depend not only on what version of SQL Server and PowerShell you have, but also on what you want to do with SQL Server.
Mini-shell (or the sqlps utility)
Starting from SQL Server 2008, SQL Server was shipped with what used to be called a mini-shell (the sqlps
utility). Back then, the mini-shell was a limited PowerShell console specifically bundled with SQL Server, which preloaded the sqlps
utility, which in turn preloaded the session with the SQL Server PowerShell providers and cmdlets.
The mini-shell can be invoked in a couple of ways. One way is to go to SQL Server Management Studio (SSMS) and right-click on a SQL Server object and choose Start PowerShell. The following screenshot shows what you will see on a SQL Server 2014 interface, which is not that different from what you will see in SQL Server 2008, SQL Server 2008 R2, and SQL Server 2012:
Once you click...