I am trying to see if a variable exists in a text file using powershell. select-string ends up retrieving all numbers with the number I am searching for.
c:\temp\numbers.txt has numbers in it like:
5
10
15
44

```
   $number = 5
   $test = get-content c:\temp\numbers.txt
   $test | select-string -pattern $number

```

This retrieves:
5
15

Is there a better way to do this? How do I get just 5 to return? Also bonus points on if there is a way to know which line 5 exists on.