Using ADO.NET from Powershell has been covered by several articles, blog entries, and discussion group postings; however alternatives methods have not been as widely written about. The article, Getting Data out of SQL Server from Powershell demonstrates three alternative methods to ADO.NET for querying SQL Server from Powershell. The approaches demonstrated are simplier than ADO.NET and include:
- SMO ExecuteWithResults
- SQL Server 2008 Powershell Cmdlet Invoke-SqlCmd
- CodePlex SQL Server Powershell Extensions function Get-SqlData
See the full article for details.