@SChalakov
But what if the text was a bit more complicated than that? For example, if the text contains punctuation?
Also, your regex won't match the last "test" because it's not followed by a space.
This looks for "word breaks" to delimit the text you're looking for. It also ignores case (which is what the Select-String does). The Get-Content gets the whole file all at once in a single string (by using the "-Raw" switch), including line breaks. The $RegexOptions modifies the regex "." to match every character, including the "\n".
$Content = Get-Content "C:\junk\Findstring.txt" -raw
$RegexOptions = [System.Text.RegularExpressions.RegexOptions]::IgnoreCase,[System.Text.RegularExpressions.RegexOptions]::SingleLine
( [regex]::Matches($Content, "\btest\b", $RegexOptions ) ).count