Skip to content

Instantly share code, notes, and snippets.

@haraldfianbakken
Last active December 14, 2015 16:29
Show Gist options
  • Save haraldfianbakken/5115167 to your computer and use it in GitHub Desktop.
Save haraldfianbakken/5115167 to your computer and use it in GitHub Desktop.
Powershell wrapper - Admin job
while($true){
$error = Get-SPLogEvent -StartTime ([DateTime]::Now).Subtract([Timespan]::FromHours(1))|? { $_.Level -eq "Error" -or $_.Level -eq "Critical"}
if($error){
[ibuddylib.BuddyManager]::Global.AnyBuddy.HeadColor = "Red";
Start-Sleep -Minutes 5;
[ibuddylib.BuddyManager]::Global.AnyBuddy.HeadColor = "Off";
} else{
[ibuddylib.BuddyManager]::Global.AnyBuddy.HeadColor = "Green";
}
Start-Sleep -Minutes 5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment