📅  最后修改于: 2022-03-11 14:51:44.264000             🧑  作者: Mango
$uriSlack = "https://hooks.slack.com/services/{guids}"
$body = ConvertTo-Json @{
pretext = "Hello world"
text = "This is the text below with a blue thingy next to it"
color = "#142954"
}
try {
Invoke-RestMethod -uri $uriSlack -Method Post -body $body -ContentType 'application/json' | Out-Null
} catch {
Write-Error (Get-Date) ": Update to Slack went wrong..."
}