title: PowerShell: Toggle "Num Lock" on and off.
body: <p>I would like to be able toggle on and off the "Num Lock" key on the keyboard. I have tried multiple examples around the web and here, with no success. This is the closest thing I've got to a solution:</p>
  
  <pre><code>[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
  [System.Windows.Forms.SendKeys]::SendWait("{NUMLOCK}")
  </code></pre>
  
  <p>The above code looks like it might work and I see the "Num Lock" indicator on my keyboard flash for a second but it doesn't "stick". </p>