title: Filtering output using "Where-Object" in Powershell
body: <p>I'm trying to get into PowerShell and have encountered my first hurdle.</p>
  
  <p>when I run</p>
  
  <pre><code>Get-Command | Where-Object CommandType -contains Cmdlet
  </code></pre>
  
  <p>My output gets filtered so that only commands with "CommandType" property value containing "Cmdlet" gets shown, like so:</p>
  
  <p><a href="https://i.stack.imgur.com/TXssV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TXssV.png" alt="enter image description here"></a></p>
  
  <p>Same thing can be done with the object "Source":</p>
  
  <pre><code>Get-Command | Where-Object Source -contains appx
  </code></pre>
  
  <p>Which gets me:</p>
  
  <p><a href="https://i.stack.imgur.com/Xg6je.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Xg6je.png" alt="enter image description here"></a></p>
  
  <p>But when i try to run:</p>
  
  <pre><code>Get-Command | Where-Object Name -contains Add
  </code></pre>
  
  <p>I get nothing.
  Why can I filter the output by the objects "CommandType", and "Source but not "Name"? I'm surely missing something here...</p>
  
  <p>Edit: i know i can run:</p>
  
  <pre><code>Get-Command -verb "get"
  </code></pre>
  
  <p>And get the desired output. But i'm trying to figure out why my "where-object" statement did not work.</p>
  
  <p>Edit 2:</p>
  
  <p>Appearantly if I use the "-match" comparison operator it works...</p>
  
  <pre><code>get-command | where-object Name -match "add"
  </code></pre>
  
  <p>But isn't "name" properties just strings? -match should be used for Regular expression comparison afaik? I'm so confused right now...</p>