Powershell from SSMS: Can't use out-gridview

Answered 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