If there is an existing transaction (with the MSSQL provider) and invoke-sqlbulkcopy is used, an error is thrown because the bulkcopy class is not expecting this.
Suggestion: modify the code to check for an existing transaction and use it if it exists.
If there is an existing transaction (with the MSSQL provider) and invoke-sqlbulkcopy is used, an error is thrown because the bulkcopy class is not expecting this.
Suggestion: modify the code to check for an existing transaction and use it if it exists.