Merged the two new functions into a single invoke-sqlquery function that uses a switch to determine if the query is a commandtext item