0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

slackにメッセージを送るプログラム

0
Posted at
# Slack APIのURLとトークンを設定
$url = "https://slack.com/api/chat.postMessage"
$token = "YOUR_SLACK_API_TOKEN"

# 送信するメッセージを設定
$message = @{
    channel = "#general" # 送信するチャンネル名
    text = "Hello from PowerShell!" # 送信するテキストメッセージ
}

# Slack APIにPOSTリクエストを送信
Invoke-WebRequest -Uri $url -Method Post -ContentType "application/json" -Headers @{Authorization = "Bearer $token"} -Body ($message | ConvertTo-Json)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?