title: Get-Content and foreach in two files
body: <p>I have two files. The first with contains hostnames (Computers.txt) and the second one contains SID (SID.txt). I want to use <code>Get-Content</code> and <code>foreach</code> to execute a command on each computer with the corresponding SID to modify registry.</p>
  
  <p>Let's take for example PC 1 (first line Computers.txt with first line SID.txt) and PC 2 (second line Computers.txt with second line SID.txt).</p>
  
  <pre><code>$Computer = Get-Content D:\Downloads\computers.txt
  $SID = Get-Content D:\Downloads\SID.txt
  foreach ($pc in $Computer)
  {
      Invoke-Command -ComputerName $pc {New-Item HKEY_USERS:\$SID -Name -Vaue}
  }
  </code></pre>