我正在尝试使用PowerShell将在文本框中输入的值输出到HTML,但是有点卡住。这是我的代码:
$button1 = New-Object System.Windows.Forms.Button
$button1.Name = "button1"
$button1.Location = New-Object System.Drawing.Point(16, 350)
$button1.Text = "Create"
$button1.add_Click({ConvertTo-HTML -title "Email Signature" -body "<p>$textBox2.Text</p>"})
产生的HTML是...
System.Windows.Forms.TextBox, Text: Chris.Text
如何使输出简单地为“
Chris
”?
最佳答案
解决了:)
答案是:$($ textBox2.Text)
关于powershell - 具有Powershell问题的ConvertTo-HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5214829/