我正在尝试通过命令行执行以下命令
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Send-MailMessage -from "mail.me" -to "mail.me" -Subject "PS test !" -Body "Hi this is a power shell mail test" -SmtpServer "mail.domain.com"
Run Code Online (Sandbox Code Playgroud)
但是我收到以下错误:
Send-MailMessage : A positional parameter cannot be found that accepts arguement « test ».
Au niveau de ligne : 1 Caractère : 17
+ Send-MailMessage <<<< -from mail.me -to mail.me -Subject PS test ! -Body Hi this is a power shell mail test -SmtpServer mail.domain.com
+ CategoryInfo : InvalidArgument: (:) [Send-MailMessage], Paramet
erBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell …Run Code Online (Sandbox Code Playgroud) 我想找到数组a1的所有元素,哪些项不是数组a2和数组a3的一部分.
例如:
$a1 = @(1,2,3,4,5,6,7,8)
$a2 = @(1,2,3)
$a3 = @(4,5,6,7)
Run Code Online (Sandbox Code Playgroud)
预期结果:
8
Run Code Online (Sandbox Code Playgroud)