Powershell 超链接以代码的形式显示

Powershell 超链接以代码的形式显示,powershell,hyperlink,Powershell,Hyperlink,我正在尝试通过powershell脚本超链接收件箱中显示的号码。但是超链接显示为代码本身,而不是所需的可单击链接 $b = $b + @{Label='ID';Expression={'a href="http://fire.sync.net/show_bug.cgi?id="$Bug_Id">$(Bug_Id)</a>'}} Add-Type -AssemblyName System.Web [System.Web.HttpUtility]::HtmlDecode($b)

我正在尝试通过powershell脚本超链接收件箱中显示的号码。但是超链接显示为代码本身,而不是所需的可单击链接

$b = $b + @{Label='ID';Expression={'a href="http://fire.sync.net/show_bug.cgi?id="$Bug_Id">$(Bug_Id)</a>'}}
Add-Type -AssemblyName System.Web
[System.Web.HttpUtility]::HtmlDecode($b)
$b=$b+@{Label='ID';表达式={'a href=”http://fire.sync.net/show_bug.cgi?id=“$Bug\U Id”>$(Bug\U Id)}
添加类型-AssemblyName System.Web
[System.Web.HttpUtility]::HtmlDecode($b)
在我的邮箱中,它显示为

http://fire.sync.net/show_bug.cgi?id“+”=“+”Bug_id>211

预期-211可单击并直接指向指定的url

超链接部分的代码-

$a = "<style>"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: gray;border-collapse: collapse; margin: 0 auto; width: 100%;}"
$a = $a + "TH{border-width: 1px; padding: 7px; border-style: solid;}"
$a = $a + "TD{border-width: 0px;}"
$b = $b + @{Label='ID';Expression={"<a href='http://fire.sync.net/show_bug.cgi?id=$Bug_Id'>$Bug_Id</a>"}}


[System.Web.HttpUtility]::HtmlDecode($b)
$a = $a + "</style>"


$body = $DataSet.Tables[0] | Select $b,Status,Summary,Deadline | convertto-html -head $a |  out-string;
$a=“”
$a=$a+“表{边框宽度:1px;边框样式:实心;边框颜色:灰色;边框折叠:折叠;边框:0自动;宽度:100%;}”
$a=$a+“TH{边框宽度:1px;填充:7px;边框样式:实心;}”
$a=$a+“TD{边框宽度:0px;}”
$b=$b+@{Label='ID';表达式={''}
[System.Web.HttpUtility]::HtmlDecode($b)
$a=$a+“”
$body=$DataSet.Tables[0]|选择$b、状态、摘要、截止日期|转换为html-头$a |输出字符串;
请帮助。

尝试以下方法:

Expression={ "<a href='http://fire.sync.net/show_bug.cgi?id=$Bug_Id'>$Bug_Id</a>" }
Expression={'}

您还缺少一个开头
请尝试展开html。您还可以通过添加
-Head
开关将样式表作为转换为html的一部分

$head=@"<style>
TABLE{border-width: 1px;border-style: solid;border-color: gray;border-collapse: collapse; margin: 0 auto; width: 100%;}
TH{border-width: 1px; padding: 7px; border-style: solid;}
TD{border-width: 0px;}
</style>

$body = @{Label='ID';Expression={"<a href='http://fire.sync.net/show_bug.cgi?id=$Bug_Id'>$Bug_Id</a>"}} | 
ConvertTo-HTML -Head $head | Out-String
"@
$head=@”
表{边框宽度:1px;边框样式:实心;边框颜色:灰色;边框折叠:折叠;边距:0自动;宽度:100%;}
{边框宽度:1px;填充:7px;边框样式:实心;}
TD{边框宽度:0px;}
$body=@{Label='ID';Expression={'}}}
转换为HTML-Head$Head | Out字符串
"@
对发送格式丰富的HTML电子邮件有一个很好的解释。

这没有帮助。:(仍然是相同的问题。