title: I cannot redirect or hide Get-VM output
body: <p>So I have a line of code to retrieve the VMID from a hyper-v vm.  Running on Server 2016 so it should be at least Powershell 5.0.</p>
  
  <pre><code>[string]$vmid = (Get-VM $VMName).VMID
  </code></pre>
  
  <p>Pulls out the ID just how I need.  The problem is the script also prints out the full result of <code>Get-VM</code>. I cannot for the life of me figure out how to mute or redirect it.</p>
  
  <p><code>[void]</code> doesn't work cause I'm pulling it into a string.</p>
  
  <p><code>*&gt; $null</code>, <code>2&gt; $null</code>, <code>1&gt; $null</code> all do nothing, and I've tried both in the parenthesis and after the expression.</p>
  
  <p>Piping to <code>Out-Null</code> has no effect either in those locations.</p>
  
  <p>Any idea how I'm supposed to hide this?  I really don't need all this info.</p>