title: Switch statement not processing
body: <p>I'm attempting to use a switch statement to control flow in my PowerShell script, but the switch isn't being processed at all.  If I run it interactively (highlight + F8 in ISE), it works without a hitch.  I validate the argument, and have tested it thoroughly.  <code>If(){}</code> statements process properly.  Is there some kind of weird bug with switch statements?  Even the <code>Default</code> argument isn't being triggered.</p>
  
  <pre><code>[CmdletBinding()]
  Param(
      [Parameter(Mandatory=$True)]
      [ValidateSet('Install','Uninstall','Verify','Enable','Disable')]
      [String]$Switch
  )
  
  **FUNCTIONS**
  
  [Int]$R = 324
  Start-Transcript 'Path\ESD.log' -Append -Force
  
  Switch ($Switch)
  {
      "VERIFY"    { $R = Verify;    Break }
      "INSTALL"   { $R = Install;   Break }
      "UNINSTALL" { $R = Uninstall; Break }
      "ENABLE"    { $R = Enable;    Break }
      "DISABLE"   { $R = Disable;   Break }
      Default { Write-Host "Unable to match: $Switch" -BackgroundColor Red }
  }
  
  Write-Host "Exiting with: $R"
  Stop-Transcript
  EXIT $R
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>PS Path\EnterpriseSiteDiscovery&gt; .\ESD verify
  Transcript started, output file is Path\ESD.log
  Exiting with: 324
  Transcript stopped, output file is Path\ESD.log
  
  PS Path\EnterpriseSiteDiscovery&gt; $LASTEXITCODE
  324
  </code></pre>
  
  <p>Content of log:</p>
  
  <pre><code>**********************
  Windows PowerShell transcript start
  Start time: 20170705154435
  **SYSTEMINFO**
  **********************
  Transcript started, output file is Path\ESD.log
  Exiting with: 324
  **********************
  Windows PowerShell transcript end
  End time: 20170705154436
  **********************
  </code></pre>