【发布时间】:2021-09-24 22:23:22
【问题描述】:
我正在研究mailkit库,我在c#的一行中发现了这样一个结构
msg.Body = new TextPart("html") { Text = "<b>html content</b>" };
在 Powershell 上我最多可以做三行
$TextPart = [MimeKit.TextPart]::new("html")
$TextPart.Text = "<b>html content</b>"
$msg.Body = $TextPart
是否可以在powershell中也写在一行上?
【问题讨论】:
标签: powershell syntax object-initializers