Run Windows PowerShell from SQL Server Management Studio
SQL Server 2012
You can start Windows PowerShell sessions from Object Explorer in SQL Server Management Studio. Management Studio launches Windows PowerShell, loads the sqlps module, and sets the path context to the associated node in the Object Explorer tree.
When you specify running PowerShell for an object in Object Explorer, SQL Server Management Studio starts a Windows PowerShell session in which the SQL Server PowerShell snap-ins have been loaded and registered. The path for the session is preset to the location of the object you right clicked in Object Explorer. For example, if you right-click the AdventureWorks2012 database object in Object Explorer and select Start PowerShell, the Windows PowerShell path is set to the following:
SQLSERVER:\SQL\MyComputer\MyInstance\Databases\AdventureWorks2012>
