If you pipe in multiple sql queries, and include the ExpectedRowCount property, you would expect the value included with the property to match the number of rows modified by all sql statements. That is not the case and results in a transaction rollback.
$sql1 = "update table1 set column1 ='value1' where pk = 1;"
$sql2 = "update table1 set column1 = 'value2' where pk = 2;"
##this will result in a rollback
($sql1,$sql2) | Invoke-SqlServerQuery -ExpectedRowCount 2 -CUD
If you pipe in multiple sql queries, and include the ExpectedRowCount property, you would expect the value included with the property to match the number of rows modified by all sql statements. That is not the case and results in a transaction rollback.