【Powershell】TeamsにWebhookで通知する

WebhookURLを取得
Powershellで実行
1 2 3 4 5 6 7 8 9 10 |
PS C:\Users> $Url = "Webhook用のID" PS C:\Users> PS C:\Users> $body = ConvertTo-JSON @{ >> text = "Hello World" >> } PS C:\Users> PS C:\Users> PS C:\Users> Invoke-RestMethod -Method Post -Uri $url -Body $body -ContentType 'application/json' 1 PS C:\Users> |
処理結果
参考
http://www.vwnet.jp/windows/PowerShell/2018080101/MicrosoftTeamsMessageFromPowerShell.htm