How do i get the respons back to prtg to set the monitor to red if the valviu is "Files are different" and to grren when the valviu is "Files are the same"
$SourceDocs = Get-ChildItem –Path C:\Temp\EXE\am0ytil.exe | foreach {Get-FileHash –Path $_.FullName} $DestDocs = Get-ChildItem –Path C:\Temp\EXE1\am0ytil.exe | foreach {Get-FileHash –Path $_.FullName}
if(compare-object ($SourceDocs.Hash) ($DestDocs.Hash)){ Write-Host 'Files are different "2"' -fore red }else{ Write-Host 'Files are the same "0"' -fore green }
Add comment