invoke-sql: Cannot process argument transformation?

Mar 23, 2015 at 6:34 PM
Hello,
I am just starting to use this module, and I am doing something that appears to be quite simple, but I am getting an error.
$mySQLConn = New-MySQLConnection -server $MySQLHost -user $MySQLAdminUserName -password $MySQLAdminPassword -database $MySQLDatabase 
$mySQLcmd = Invoke-SQL -sql $sqlstmt -connection $mySQLConn
Then I get this error:
Invoke-Sql : Cannot process argument transformation on parameter 'connection'. Cannot convert the
"MySql.Data.MySqlClient.MySqlConnection" value of type "MySql.Data.MySqlClient.MySqlConnection" to type
"System.Data.SqlClient.SqlConnection".
Any suggestions?
Coordinator
Mar 24, 2015 at 12:17 AM
You accidentally used invoke-sql (out of the adolib module) instead of one of the invoke-MySQL functions.

it's either invoke-mysql, invoke-mysqlquery depending on whether the sql statement has a result set.

Mar 25, 2015 at 4:19 PM
Ugh! Thanks for pointing that out!