title: create a typed read-only variable in PowerShell
body: <p>Is it possible to create a typed read-only variable/constant in a PowerShell script? Afaik there a two ways to create a variable:</p>
  
  <p>First way:</p>
  
  <p><code>[int] $myVar1</code>
  But I am not aware of any constant / readonly keyword nor any other way to prevent changes from this variable.</p>
  
  <p>Second via Cmdlet:</p>
  
  <p><code>New-Variable -Name 'myVar1' -Option ReadOnly</code> (editable with -Force) or
  <code>New-Variable -Name 'myVar1' -Option Constant</code></p>
  
  <p>But I don't know any way to apply both. Any ideas?</p>