title: Powershell getting chassis types info
body: <p>I'm currently working on a powershell script that should retrieve the type of machine i'm working on and i've looked at several examples already but i can't get it to work properly. I want to retrieve my chassis type so i can determine if i'm working on a laptop or desktop.</p>
  
  <p>This is my code: </p>
  
  <pre><code>$isLaptop = [bool](Get-WmiObject -Class Win32_SystemEnclosure -Property 
  ChassisTypes | Where-Object ChassisTypes -in '{9}', '{10}', '{14}')
  </code></pre>
  
  <p>The problem is that even when i'm running the script on a desktop i'm getting a response which is true although the chassis type of my desktop is {3}.</p>
  
  <p>I'm probably overlooking something stupid but would be nice if someone could give me some assistance here i'm kinda new to powershell aswell.</p>