title: PowerShell date format not accepted in SQL
body: <p>I'm having kind of a strange problem. When the server's <code>Region and Language</code> settings is set to <code>English (United States)</code> there are no issues with objects containing the date and time. But when I change it to my countries local <code>Dutch (Belgium)</code> I am experiencing problems in some of my PowerShell scripts.</p>
  
  <p>Is there somewhere a variable in PowerShell that needs to be set to fix this? Or do I have to default to English date formats on the server all the time?</p>
  
  <p>We use for example the <code>SQL module</code> provided by Don Jones for filling up an SQL database. This line generates an error when it's set to Dutch, but not when it's set to English:</p>
  
  <pre><code>if ($properties[$property] -eq 'datetime2') { [datetime]$prop = $result.GetDateTime($result.GetOrdinal($property)) }
  </code></pre>
  
  <p>The only thing I do to retrieve the date is <a href="http://technet.microsoft.com/en-us/library/hh849887.aspx" rel="nofollow noreferrer">Get-Date</a> without anything special. And it generates this error when set to <code>Dutch (Belgium)</code>:</p>
  
  <pre><code>Exception calling "ExecuteNonQuery" with "0" argument(s): "Conversion failed when converting date and/or time from char
  acter string."
  </code></pre>
  
  <p>I've experienced the same problem when generating stuff for <a href="http://en.wikipedia.org/wiki/Microsoft_Excel" rel="nofollow noreferrer">Excel</a> sheets. It also complains about the date time format.</p>