title: System.Threading.Timer kills the PowerShell console
body: <p>When I run this in a PowerShell console:</p>
  
  <pre><code>$callback = [System.Threading.TimerCallback]{
      param($state)
  }
  
  $timer = [System.Threading.Timer]::new($callback, $null,
      [timespan]::Zero,
      [timespan]::FromSeconds(1))
  </code></pre>
  
  <p>Then once <code>$callback</code> gets called (I made sure that this is the root cause, by changing the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.timer.-ctor?view=netframework-4.7.2#System_Threading_Timer__ctor_System_Threading_TimerCallback_System_Object_System_TimeSpan_System_TimeSpan_" rel="nofollow noreferrer"><code>dueTime</code> constructor's parameter</a> from <code>[timespan]::Zero</code> to longer delays), the whole console process crashes, saying that <code>powershell has stopped working</code>.</p>
  
  <p>What could be the reason? how can I overcome this?</p>