Tuesday, 10 March 2020

powershell script to trigger message in slack using web hock



    $uriSlack = "URL"
        $body = ConvertTo-Json @{
        pretext = "test"
        text = "test"
        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..."
    }

No comments:

Post a Comment

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...