$abc = "C:\Program Files (x86)\BigFix Enterprise\BES Relay\logfile.txt"
$checkerrorlines = "GetExpectedVersionOfParent Error: Parent response did not contain a site version"
if((Get-content $abc).Contains($checkerrorlines))
{
Write-Host "Has gather issue"
}
else
{
Write-Host "No gather issue found on relay"
}
Asked
Active
Viewed 55 times
-4

boxdog
- 7,894
- 2
- 18
- 27

Vishal Tarwani
- 11
- 6
-
1Possible duplicate of [How to redirect the output of a PowerShell to a file during its execution](https://stackoverflow.com/questions/1215260/how-to-redirect-the-output-of-a-powershell-to-a-file-during-its-execution) – Peter B Oct 29 '19 at 11:06
-
1Please read the help about [how to ask](https://stackoverflow.com/help/how-to-ask) good questions. Then edit the question. Pick a good subject and add the actual question into the question body. – vonPryz Oct 29 '19 at 11:13
1 Answers
0
You used Get-Content to get the content- you can use Set-Content to set it!
Set-Content -Path C:\OnSomePath\Result.log -Value 'No gather issue found on relay'

Mark
- 414
- 3
- 7