You create and save a text file that contains Transact-SQL (T-SQL) statements to create a new table.
You need to execute the script.
Which PowerShell cmdlet should you use?
You should use the Invoke-Sqlcmd cmdlet. You can use this cmdlet to execute a literal T-SQL command string or the contents of a text file that contains T-SQL commands.
You should not use the Write-SqlTableData cmdlet. This cmdlet is used to write data directly to an existing table, not to create a new table.
You should not use the Invoke-ASCmd cmdlet. This cmdlet is used to execute queries or statements against a Microsoft SQL Server Analysis Services instance. It is not used to execute standard database queries.
You should not use the Invoke-ProcessTable cmdlet. This cmdlet is used to process Analysis Services tables against a specified RefreshType.