title: Case-insensitive PowerShell replacement
body: <p>I have the following PowerShell script:</p>
  
  <pre><code>$RegExplorer = Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
  $NullSessionPipes = "$($RegExplorer.NullSessionPipes)"
  $NullSessionPipes
  $NullSessionPipes =  $NullSessionPipes.replace("browser", "")
  $NullSessionPipes
  </code></pre>
  
  <p>The script works fine as long as the registry key examining exactly matches the case I've specified - "browser".</p>
  
  <p>However if the case was different in the registry key say "BROWSER" or "Browser" it doesn't do the replacement.</p>
  
  <p>I'm looking for some way to make string.replace case insensitive. I know I could convert the string using .tolower or .toupper first to make comparison easier, but I don't know if this particular registry key or applications which access it are case sensitive, so I don't want to change the case of existing key.</p>
  
  <p>Is there an easy way to do this?</p>