You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
508 B

function wechattalk()
{
curl -Method Get "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxx"
}
$msg= "Windows Server<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD>
"
$counter= 0
#<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD><EFBFBD>
if (Get-ChildItem D:\serverbackup\WindowsImageBackup\test\Catalog | Where{$_.LastWriteTime -lt (Get-Date).AddDays(-32)})
{
$msg= $msg +
"
<EFBFBD><EFBFBD> test<EFBFBD><EFBFBD>10.8.8.1<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
"
$counter= $counter + 1
}
if ($counter -eq 0){
$msg= "Windows Server <EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
}
$msg= $msg +
"
<EFBFBD><EFBFBD><EFBFBD>Դ 127.0.0.1
"
wechattalk