title: How to check if response header contains certain headers powershell
body: <p>I'm using iwr to make a request like so:</p>
  
  <pre><code>iwr "http://someapi/param" -UseBasicParsing -Method Head
  </code></pre>
  
  <p>This gets me the headers which looks something like this:</p>
  
  <pre><code>$var1 = "Timing-Allow-Origin: *
  X-CID: 1
  Accept-Ranges: bytes
  Content-Length: 43
  Cache-Control: public,max-age=172800
  Content-Type: image/gif
  Other headers
  </code></pre>
  
  <p>How do I check if the headers contain this:</p>
  
  <pre><code>"Timing-Allow-Origin"="*"
  "Cache-Control"="public,max-age=172800"
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>$var2.RawContent = iwr "http://someapi/param" -UseBasicParsing -Method Head
  Write-Host ($var2.RawContent -like "*Timing-Allow-Origin: *")
  </code></pre>
  
  <p>But this returns false for some reason. Is there a way to do this?</p>