Run Windows PowerShell from SQL Server Management Studio
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
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: