I'm trying to find a line that matches the below pattern in a file. I can see the pattern is output as I expect but it doesn't match.
String in file
"5/29/2019 12:01:03 PM - Sys - Logged Successfully"
Variables
$pattern = "Logged Successfully"
$datePattern = "5/29/2019"
Code - Working - Matches ok
$reponse = select-string -Path $path\$file -Pattern $pattern -allmatches -simplematch
Code - Not Working
$reponse = select-string -Path $path\$file -Pattern "$($datePattern).*$($pattern)" -allmatches -simplematch
Maybe im missing something very simple, any help greatly appreciated.