Powershell数据处理

1、导出csv文档

Export-Csv D:\ps\xxx.csv -Encoding UTF8 -NoTypeInformation

2、发送mail

$from="frommailaddress"
$to="tomailaddress"
$cc="ccmailaddress"
$subject="主题"
$smtpserver="sendmailsmtpserver"
$message="<style type='text/css'>
<!--
.style1 {font-size: 16px;
    color: #000099;
    font-family: '新細明體'; }
-->
</style>
<p class='style1'>Dears</p>
<p class='style1'>内容,内容中可以带变量</p>
</p>
"
#发送邮件,可以带附件文档
Send-mailmessage –bodyashtml –from $from –to $to -cc $cc –subject $subject –body $message –smtpserver $smtpserver -attachments D:\ps\userPermissioninfo_$CurrentDate.csv -Encoding ([System.Text.Encoding]::Utf8)

 

3、导入数据库

参考http://www.cnblogs.com/scentpath/p/PowershellSQL.html

posted @ 2017-06-24 15:03  寻香径  阅读(476)  评论(0编辑  收藏  举报