I'm trying to create a powershell monitor, to read a log file and look for a word.
Script is as so:
$Lines = Get-Content -path "C:\Windows\tracing\logfile.log"
foreach ($Line in $Lines){
if ($Line -like "*Successful*"){$Health = "good"}
}
I get this error when testing the script:
Get-Content : Cannot find path 'C:\Windows\tracing\logfile.log' because it does not exist.
But it does exist, and I am using sufficient credentials.