title: How to pass boolean values to a PowerShell script from a command prompt
body: <p>I have to invoke a PowerShell script from a batch file. One of the arguments to the script is a boolean value:</p>
  
  <pre><code>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -File .\RunScript.ps1 -Turn 1 -Unify $false
  </code></pre>
  
  <p>The command fails with the following error:</p>
  
  <pre><code>Cannot process argument transformation on parameter 'Unify'. Cannot convert value "System.String" to type "System.Boolean", parameters of this type only accept booleans or numbers, use $true, $false, 1 or 0 instead.
  
  At line:0 char:1
  +  &lt;&lt;&lt;&lt; &lt;br/&gt;
  + CategoryInfo          : InvalidData: (:) [RunScript.ps1], ParentContainsErrorRecordException &lt;br/&gt;
  + FullyQualifiedErrorId : ParameterArgumentTransformationError,RunScript.ps1
  </code></pre>
  
  <p>As of now I am using a string to boolean conversion inside my script. But how can I pass boolean arguments to PowerShell?</p>