title: Can someone explain why this doesn't work VS this
body: <p>So I have revisited a profile script I was writing and I tried to do it from scratch with what I have learnt, however I got to the part where I search for a Regkey based on a username.</p>
  
  <p>The -Like function worked but when i done -eq it didn't, what am I missing?</p>
  
  <pre><code>Get-ChildItem $keypath | Where-Object {
      (Get-ItemProperty $_.PSPath).ProfileImagePath -like "*${Username}*"
  }
  </code></pre>
  
  <p>The above worked but I also expected the below to work as well.</p>
  
  <pre><code>Get-ChildItem $keypath | Where-Object {
      (Get-ItemProperty $_.PSPath).ProfileImagePath -eq"*${Username}*"
  </code></pre>
  
  <p>Also why wouldn't this work</p>
  
  <pre><code>Where-Object { $_.ProfileImagePath -eq "$Username" }
  </code></pre>
  
  <p>I don't understand what is wrong with the -eq</p>
  
  <p>I will also point out the working code was supplied to me ages ago on here so it's still greatly appreciated.</p>