title: In PowerShell how do I load multiple values into a variable?
body: <p>I have a requirement at work to check several registry key values and I want to automate this process using PowerShell. One of the registry keys that I check has 3 values and I am not able to successfully check it using my PowerShell script.</p>
  
  <p>I do not believe I am correctly loading the <code>$value</code> variable so that it can be compared to the value of <code>$path</code>.</p>
  
  <pre><code>$path = (Get-ItemProperty HKLM:\System\CurrentControlSet\Services\LanManServer).NullSessionPipe
  
  $value = “netlogon samr lsarpc”
  
  if ($path -ne $value) {
      Write-Host “Value is incorrect or missing.”
  } else {
      Write–Host “Config is correct.”
  }
  </code></pre>
  
  <p>I expect the output to be</p>
  
  <blockquote>
    <p>Config is correct.</p>
  </blockquote>
  
  <p>Instead I get</p>
  
  <blockquote>
    <p>Value is incorrect or missing.</p>
  </blockquote>
  
  <p>Using Regedit I can see that the key has the correct values.</p>