ctigeek / InvokeQueryPowershellModule

A Powershell module of Cmdlets for querying most types of databases.
https://www.powershellgallery.com/packages/InvokeQuery
MIT License
58 stars 10 forks source link

Bug when using connection string with Invoke-SqlServerQuery #10

Closed Sarafian closed 3 years ago

Sarafian commented 6 years ago

How to reproduce issue When I using the -ConnectionString parameter with e.g. Invoke-SqlServerQuery

Invoke-SqlServerQuery -ConnectionString $connectionstring -Sql $sql

I get an error

Invoke-SqlServerQuery : Object reference not set to an instance of an object.

Workaround Feed the respected values from the connectionstring as separate parameters

Invoke-SqlServerQuery -Server $server -Database $database -Credential $credentials -Sql $sql
diontools commented 6 years ago

I also found this problem. Failure to get local instance name when SQL server is not installed on my machine. I modified to not get the local instance name when ConnectionString is specified.

crshovrd41 commented 4 years ago

I am also receiving this same error.