If you want to run command against SQL such as Invoke-SQLCmd or just run a query against a table or view and return a list of objects, you need to have the SQL cmdlets. You can download them using the link below. Prior to Posh 3.0 you will need to run Import-Module SQLServer. Posh 3.0 will auto import upon first command run.
Tip: A nice little feature of the SQL cmdlets are creating a PSDrive to your SQL box. You can do so by running the following command.
New-PSDrive -name Name -PSProvider SQLServer -Root "SQLServer:\SQL\SQLServerName"
No comments:
Post a Comment