0
我從cmd .bat腳本運行此PowerShell命令。它似乎在抱怨'要求'作爲一個論點。命令中的唯一'請求'在引號內。這是怎麼回事?Powershell發送郵件失敗
M:>powershell send-mailmessage -to "[email protected]" -from "[email protected]" -subject "Standard Extract Request" -SmtpServer "mail.company.com" -attachment "file.txt"
Send-MailMessage : A positional parameter cannot be found that accepts argument 'Request'.
At line:1 char:1
+ send-mailmessage -to [email protected] -from [email protected] -subject Stan ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Send-MailMessage], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SendMailMessage
你是從CMD運行的嗎? – Kiran