最簡單的方式為使用curl 來達成,cmd 預設的curl 會有問題無法使用,請改用power shell curl指令

Jenkins 請自行安裝 power shell

申請 lineNotify 權杖  https://notify-bot.line.me/  請備份權杖後面會使用到

 

附上程式
$uri = "https://notify-api.line.me/api/notify"
$token = "Bearer 貼上權杖"
$header = @{Authorization = $token}
$body = @{message = 'PowerShell Notification'}
$res = Invoke-RestMethod -Uri $uri -Method Post -Headers $header -Body $body 
echo $res

arrow
arrow
    文章標籤
    jenkins line notify
    全站熱搜

    狼翔月影 發表在 痞客邦 留言(0) 人氣()