title: $Hostname.contains | Where {$_.name -Match ("test")})
body: <p>Hello I have done this script in PowerShell </p>
  
  <pre><code>$hostname = get-content env:computername
  $host = "Desk"
  if ($hostname.contains | Where {$_.name -Match ("test")})
  {
  $chars = [char[]]"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
  $name = [string](($chars[0..25]|Get-Random)+(($chars|Get-Random -Count 
  10) -join ""))
  
  Rename-Computer -NewName $host$nam
  Write-Host -foregroundcolor Yellow "New Computername is $host$name"
  }
  
  else {
  Write-Host -foregroundcolor Red  "This is not a test pc "
  Start-Sleep -s 10
  Exit
  }
  </code></pre>
  
  <p>which is working fine when I am looking only for the word "test"
  what i am trying to do is to have more search criteria   like</p>
  
  <pre><code>if ($hostname.contains | Where {$_.name -Match ("test" -or "test01" -or 
  "test02" -or "test03" -or "test04" -or "test05")})
  </code></pre>
  
  <p>Thank you.</p>