I have been trying to check if a word contains in a webpage. In a nutshell, I tried using:
invoke-WebRequest https://example.com | select-string "some text"
Invoke-WebRequest returns more than just the content of the web page (e.g. headers, response code, etc). You need to use the Content property from the response to get to the content of the web page:
if ((Invoke-WebRequest "https://example.com").Content | Select-String "some text") {
Write-Host "I found the text."
}