title: Flip global boolean value by reference
body: <p>I'm just wondering how I can flip global variable by reference. There are no issues without reference or with local variables. But when I'm using global variable then I always getting same output</p>
  
  <p>Like:</p>
  
  <pre><code>$global:online = $true
  
  function Get
  {
    [REF]$global:online.Value = !([REF]$global:online.Value)
    return [REF]$global:online.Value
  }
  
  Get
  Get
  </code></pre>
  
  <p>And the output will be:</p>
  
  <pre><code>Value
  -----
  False
  False
  </code></pre>
  
  <p>What's wrong with my code? Thanks!</p>