📜  slack powershell 命令 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:44.264000             🧑  作者: Mango

代码示例1
$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..."
}