我有社区任务来发送邮件。但在主题本身,如果我添加 LDAP 用户的显示名称,我会知道谁在构建。
遵循 Powershell 中的代码会给我邮件 ID 和显示名称
$searcher = [adsisearcher]"(samaccountname=$env:USERNAME)"
$mailid= $searcher.FindOne().Properties.mail
$DispName= $searcher.FindOne().Properties.displayname
有什么方法可以在 Msbuild 中获取邮件 ID 和显示名称,还是通过内联任务调用 powershell 命令更好?