【发布时间】:2022-06-15 19:59:44
【问题描述】:
我正在使用 TeamCity 构建我的项目。 在我的一个构建步骤中,我放置了一个 Powershell 脚本,该脚本使用 Webhook 向 MS Teams 频道发送消息。
$url = "https://..."
$body = @{
title = "MtTitle";
text = "Visit: $url";
} | ConvertTo-Json
$postBody = [Text.Encoding]::UTF8.GetByres($body)
Invoke-WebRequest -Method Post -Uri "https://mycorp.webhook.office.com/..." -Body $postBody -ContentType "application/json" -UseBasicParsing
由于上述脚本,消息按预期发送到 Teams 频道,但 URL(Visit: 之后的字符串)显示为纯文本。
如何使它成为可点击的超链接?
我应该使用如下链接所示的 MessageCard 吗?
Get Build Job URL in TeamCity Build Step
【问题讨论】:
标签: html json powershell teamcity microsoft-teams