title: Two variables in one loop
body: <p>I am currently working on a script which should query a machine by hostname and ip. </p>
  
  <pre><code>$IP = (get-content "C:\Users\me\Desktop\PowerShell\ips.txt")
  $hostname = (get-content "C:\Users\me\Desktop\PowerShell\hostnames.txt")
  </code></pre>
  
  <p>Now I need to insert the <code>$IP</code> and <code>$hostname</code> into a string.</p>
  
  <pre><code>write-host "This is my $IP, this is my $hostname"
  </code></pre>
  
  <p>So far I tried to use a for loop and increment I every loop, but instead of taking just one insert from my txt file it took all.</p>
  
  <pre><code>for ($i=0; $i -lt 1; $i++ )
  </code></pre>
  
  <p>How can I achieve that my loop takes one line from the one file and one from the other?</p>