How can I add a clickable link to summary of TFS build?
Powershell Code:
function AddSummaryMessage{
$file = Get-ChildItem $outputFolder -name "dotcover.html";
if ($file){
$linkPath = "file://///" + $outputFolder.replace("C:\", "").replace("\", "/") + "dotcover.html"
$linkPath = "<a href="""+ $linkPath +""">view dotCover report</a>"
LogMessage("File path: " + $linkPath)
$linkPath | Out-File -FilePath ($outputFolder + "link.txt") -Append
$file = Get-ChildItem $outputFolder -name "link.txt";
LogMessage("link file: " + ($outputFolder + $file))
$path = ($outputFolder + $file)
Write-Host "##vso[task.addattachment type=Distributedtask.Core.Summary;name=DotCover Report;]$path"
}
}
The file does exist and gets created. Then in my link.txt I have this text:
<a href="file://///tfsbuilddev03/Builds/tfsbuilddev03/Agent1/6/s/dotCover/dotcover.html">view dotCover report</a>
However when I hover over it it points somewhere else:
BTW, copying this string (from the link.txt file) to browser, does open html file correctly:
file://///tfsbuilddev03/Builds/tfsbuilddev03/Agent1/6/s/dotCover/dotcover.html