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.
This issue is fixed in the following cumulative updates for SQL Server:
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Learn about the terminology that Microsoft uses to describe software updates.