• When I need to execute a query with parameters I just create a PowerShell script for that specific purpose and load LibrarySmo at the beginning of the script. Here's a simple example.

    param($au_lname)

    $scriptRoot = Split-Path (Resolve-Path $myInvocation.MyCommand.Path)

    . $scriptRoot\LibrarySmo.ps1

    $srcServer = 'Z002\SqlExpress'

    $qry = @"

    SELECT * FROM dbo.authors

    WHERE au_lname = '$au_lname'

    "@

    Get-SqlData $srcServer 'pubs' $qry

    To execute save the code as a ps1 file (here I'm using getAuthor.ps1). You'll also need to change the $srcServer variable or add it as a parameter to script and pass the server name.

    ./getAuthor "White"

    Also when I need to load the contents of a file such as a .sql file, I'll use the .NET ReadAllText method:

    $qry = [System.IO.File]::ReadAllText("c:\users\u00\scripts\pubqry.sql")

    As far Get-Help, eventually I plan on creating a proper snapin with Get-Help functionality in a future release.