You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately though I'm in a similar situation as him.
The company I work for has switched to slack instead of hipchat, so I literally never use hipchat anymore, which makes adding things or changing things much harder.
I've never created powershell snap-ins before, but it's all .net I believe and would be pretty easy to call this library (or just use the raw REST API) from powershell.
Suggestion: working together with https://github.com/hugorodgerbrown/HipChat.net
Question: Can I use Hipchat and Powershell like Slash ?
https://gist.github.com/magnetikonline/11007e42d86f490b84f8
https://github.com/jgigler/Powershell.Slack/blob/master/Send-SlackMessage.ps1
http://geeks.ms/enterprise/2016/02/15/monitorizar-eventos-con-powershell/
function Send-SlackMessage([string]$message, [string]$userName, [string]$channel="#tests"){
$postSlackMessage = @{token="EL_TOKEN_SLACK_VIENE_AQUI";channel=$channel;text=$message;username=$userName;icon_url="ICONO.png"}
$body = Invoke-RestMethod -Uri https://slack.com/api/chat.postMessage -Body $postSlackMessage -method Post
}
$time=Get-Date
$time=$time.addHours(-1)
$section="Application"
$errors = get-EventLog -LogName $section -EntryType Error -After $time -Source "Application Error"
$errors | foreach {
$username=$env:computerName+": "+($.Source)+"(ID "+($.InstanceID)+")"
write-host $username
write-host "--------------------------------"
write-host $.Message
send-SlackMessage -message $.Message -userName $username -channel "#tests"
}
The text was updated successfully, but these errors were encountered: