title: Write-SqlTableData: The given value of type String from the data source cannot be converted to type bit of the specified target column
body: <p>I am trying to write to a table using <code>Write-SqlTableData</code>. The name is altered since it is a company database.</p>
  
  <p>Environment: </p>
  
  <ul>
  <li>Windows 8.1 with Powershell 5.0, SqlServer module 21.0.17099</li>
  </ul>
  
  <p>Command:</p>
  
  <p><code>Write-SqlTableData -DatabaseName 'dbname' -ServerInstance sql1 -TableName tablename -InputData (1,'1346',$false,'CalendarInvite') -Force -SchemaName "dbo"</code></p>
  
  <p>Error: <code>Write-SqlTableData : Input array is longer than the number of columns in this table.</code></p>
  
  <p>Table columns:</p>
  
  <ul>
  <li>ID: int identity</li>
  <li>Scope: int</li>
  <li>ContextID: ntext</li>
  <li>FeatureEnabled: bit</li>
  <li>Type: ntext</li>
  </ul>
  
  <p>I don't know why I get the error. Four values should be enough, and I give them in the column order.</p>
  
  <p>I also tried to use a hash table, but the error is more confusing.</p>
  
  <ul>
  <li><p>Hash table: <code>@{Scope=1;ContextID='1346';FeatureEnabled=$false;Type='CalendarInvite'}</code></p></li>
  <li><p>Error: <code>Write-SqlTableData : The given value of type String from the data source cannot be converted to type int of the specified target column.</code></p></li>
  </ul>
  
  <p>I am totally confused. What's wrong with my command?</p>
  
  <hr>
  
  <p>Edit:
  The command works on my testing SQL (13.0.1601.5) but team testing SQL (11.0.3156.0). Maybe version matters?</p>