Powershell from SSMS: Can't use out-gridview
-
Wednesday, August 15, 2012 6:13 PM
From SQL Server Management Studio, I launch Powershell (right-click on and object and select "Start Powershell"). Then I try to run a command and display the results in a grid view, e.g.
ls | out-gridview
However, this gives errors:
The term 'out-gridview' is not recognized as the name of a cmdlet, function, sc
ript file, or operable program. Check the spelling of the name, or if a path wa
s included, verify that the path is correct and try again.
At line:1 char:17
+ ls |out-gridview <<<<
+ CategoryInfo : ObjectNotFound: (out-gridview:String) [], Comman
dNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
What should I do to use out-gridview from Powershell when launched from SSMS? (Note that it works fine if I launch PowerShell standalone)
Environment: Windows XP, SP3, Powershell 2.0, Sql Server 2008 R2
GWB
All Replies
-
Wednesday, August 15, 2012 6:27 PMModerator
Hi Gerald, unfortunately sqlps.exe doesn't take advantage of a couple of these nice PowerShell V2 cmdlets without doing a bit of configuring in your environment. There are a couple nice external blog entries about making the changes here:
http://www.maxtblog.com/2010/11/denali-get-your-sqlpsv2-module-set-to-go/
http://sev17.com/2010/07/making-a-sqlps-module/
Best of luck,
Sam Lester (MSFT)
This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.- Proposed As Answer by retracement Saturday, August 18, 2012 12:27 AM
- Marked As Answer by Samuel Lester - MSFTMicrosoft Employee, Moderator Saturday, August 18, 2012 5:05 AM

