title: Match Serial Number to a given computername
body: <p>I want my rename my computer to a specific computername.
  The script should identify my serial number and match the given computername.</p>
  
  <p>For example I have a list of serial numbers with a specific computername.</p>
  
  <pre><code>txt.file
  
  $COMPUTERNAME01;$SERIALNUMBER
  $COMPUTERNAME02;$SERIALNUMBER
  $COMPUTERNAME03;$SERIALNUMBER
  $COMPUTERNAME04;$SERIALNUMBER
  </code></pre>
  
  <pre><code>rename.ps1
  
  $serial = gwmi win32_bios | select -ExpandProperty Serialnumber
  $pos = $name.IndexOf(";")
  $leftPart = $name.Substring(0,$pos)
  $rightPart = $name.Substring($pos +1)
  $newName = $leftPart WHERE $righPart eq $serial
  rename-computer -newname $newName
  </code></pre>
  
  <p>I guess the error is at the WHERE command but I really dont know what to put in it</p>