|
********************** Windows PowerShell 脚本开始 开始时间: 20230418134440 用户名: hello-kitty\dx RunAs 用户: hello-kitty\dx 配置名称: 计算机: hello-kitt (Microsoft Windows NT 10.0.19044.0) 主机应用程序: C:\windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe 进程 ID: 10024 PSVersion: 5.1.19041.2673 PSEdition: Desktop PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.2673 BuildVersion: 10.0.19041.2673 CLRVersion: 4.0.30319.42000 WSManStackVersion: 3.0 PSRemotingProtocolVersion: 2.3 SerializationVersion: 1.1.0.1 ********************** 已启动脚本,输出文件为 C:\Users\dx\Documents\PowerShell_transcript.hello-kitty.OEB_ec3r.20230418134440.txt PS C:\Users\dx> $Username = hello-kitt@123.dog + $Username = hello-kitt@123.dog + ~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (hello-kitt@123.dog:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException hello-kitt@123.dog : 无法将“hello-kitt@123.dog”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 13 + $Username = hello-kitt@123.dog + ~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (hello-kitt@123.dog:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\dx> $Username = 'hello-kitt@123.dog' PS C:\Users\dx> $password = ConvertTo-SecureString GOODDOOG -AsPlainText -Force PS C:\Users\dx> $cred = New-Object System.Management.Automation.pscredential($Username, $password) PS C:\Users\dx> $from = 'hello-kitt@123.dog' PS C:\Users\dx> $to = 'miki-mouse@123.mice' PS C:\Users\dx> $server = 'smtp.123.dog' PS C:\Users\dx> Send-MailMessage -From $from -To $to -Subject hello -Body 'hello world!' -SmtpServer $server -Credential $cred -Attachments('C:\Users\dx\Desktop\机器学习\2205.01068 Meta OPT.pdf', 'C:\Users\dx\Desktop\data\test.csv') PS C:\Users\dx> Send-MailMessage -From $from -To $from -Subject hello -Body 'hello world!' -SmtpServer $server -Credential $cred -Attachments('C:\Users\dx\Desktop\机器学习\2205.01068 Meta OPT.pdf', 'C:\Users\dx\Desktop\data\test.csv') PS C:\Users\dx> Stop-Transcript ********************** Windows PowerShell 脚本结束 结束时间: 20230418141446 **********************
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-23 04:53
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社