以下是Powershell I使用的版本:
$ PSVersionTable.PSVersion收益率:
Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1
这是命令:
Send-MailMessage -To "someadmin@somedomain.com" -Body "This is just a test" -Subject "Test" -UseSsl
-Port 587 -SmtpServer 'smtp.office365.com' -From 'someadmin@somedomain.com' -Credential $creds
这是错误:
Send-MailMessage : A parameter cannot be found that matches parameter name 'Port'.
At line:1 char:105
+ Send-MailMessage -To "someadmin@somedomain.com" -Body "This is just a test" -Subject "Test" -UseSsl -Port <<<< 587 -S
mtpServer 'smtp.office365.com' -From 'someadmin@somedomain.com' -Credential $creds
+ CategoryInfo : InvalidArgument: (:) [Send-MailMessage], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SendMailMessage
那个版本的Powershell中的Port
参数是什么?我是否需要升级PowerShell才能使用它?