尝试获取在Artifacts Run Powershell脚本中使用的开发人员测试实验室VM用户名

问题描述

我们创建了人工制品 “克隆Git存储库”-从git hub克隆PS1脚本 “运行Powershell”运行PS1脚本。 这些工件链接到Formulae。

在创建新VM时,将应用公式运行以运行PS1脚本。 公式运行后,尝试使用下面的powershell ps1脚本发送邮件。

PS1脚本

STATIC_URL = '/static/'
STATIC_ROOT= os.path.join(BASE_DIR,"static","static_root")

STATICFILES_DIRS = [
    os.path.join(BASE_DIR,"static"),]

我很累,但是脚本无法发送消息可能是因为... ... ##Send mail to the User email $ipV4 = Test-Connection -ComputerName (hostname) -Count 1 | Select -ExpandProperty IPV4Address $emailId = $env:UserName+"@gmail.com" $body = "<html> <body> Hi $emailId,</br> </br> Your VM $ipV4 is ready to access. <br/> Thanks,</br> Digital Engagement Team </body> </html>" Send-MailMessage -To $emailId -from *** -Subject "Azure VM $ipV4 is Ready" -SmtpServer ****** -port 25 -Body $body -BodyAsHtml 无效。如何获取VM用户名作为PS1的参数,以便我可以附加gmail.com并发送?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)