Skip to content

Instantly share code, notes, and snippets.

@KMR-zoar
Created April 7, 2017 04:31
Show Gist options
  • Save KMR-zoar/6d972fdaf2436eaf64cbed7c44cb4a6b to your computer and use it in GitHub Desktop.
Save KMR-zoar/6d972fdaf2436eaf64cbed7c44cb4a6b to your computer and use it in GitHub Desktop.
function Push-Notification () {
$webhookuri = ""
$username = ""
$datetime = Get-Date -Format "yyyy/MM/dd-HH:mm:ss"
$text = @{ text = "$username $env:USERDOMAIN has task completed. $datetime"; link_names= 1}
$payload = ConvertTo-Json -InputObject $text
Invoke-RestMethod -Uri $webhookuri -Method Post -Body $payload > $null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment