System.Data.SqlClient.SqlCommand represents a SQL statement executed through an open SQL Server connection. Set its Connection and CommandText properties, then call ExecuteNonQuery() when the statement returns no rows. Suppress the method’s successful -1 result with Out-Null. Keeping SQL in a here-string makes formatting, variable insertion, and verbose syntax checking easier. section 26.3
Create a table from PowerShell
New-Object System.Data.SqlClient.SqlCommand creates the command, which receives an opened SqlConnection and a here-string containing conditional CREATE TABLE SQL. ExecuteNonQuery() runs the definition, and Close() releases the connection afterward.
