You use the invoke-sqlcmd cmdlet to execute a query statement in an instance of SQL Server 2014 or 2016. However, if execution fails because of an error, the query statement is executed multiple times.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Article ID: 4010159 - Last Review: 2017 mar. 20 - Revision: 12