Retrieving exact string from file using powershell script : I used the below steps to retrieve a string from file

    $variable = 'abc@yahoo.com'
    $test = $variable.split('@')[0];
    $file = Get-Content C:\Temp\file1.txt | Where-Object { $_.Contains($test) }

This results in all lines that contain substring $test. I just want the result to contain only the lines that has exact word $test.

For example, If a line contains abc_def@yahoo.com and abc@yahoo.com I just want the result to be abc@yahoo.com

Can anyone help?