-
1、企业微信添加机器人,记住接口机器人webhook地址
企业微信APP——选择群聊——点击右上角——选择群机器人(创建)
创建机器人
-
2、搜索并运行
powershell ise
运行power shell ise
-
3、输入以下命令并运行,正常运行后可收到机器人发送的消息
注意:$url中的地址为你的机器人地址;content中的内容为你想发送的内容
$url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3e4646656667cf"
Invoke-WebRequest $url -Method POST -ContentType "application/json;charset=utf-8" -Body '{"msgtype": "text","text": {"content": "[太阳]各位小伙伴,健康申报天天有约![呲牙]\n [爱心]请点击以下链接\nhttps://www.wjx.cn/jq/55555555555357.aspx\n[嘿哈][嘿哈]","mentioned_list":["@all"]}}'

- 4、能正常收到消息后,将命令另存为
tixing.ps1(文件名自定义,记住保存路径)
保存脚本

- 5、搜索并打开
powershell
并执行如下命令,并输入y
Set-ExecutionPolicy Unrestricted

- 6、打开计算机管理器

-
7、创建计划任务
1




程序或脚本地址为C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
添加参数为第4步中保存的文件的,具体地址自行查看



定时发送企业微信消息完成,需保证每天此时间段,该电脑为开机状态
如需调试,可编辑最后一张图中的计划任务,将时间修改到最近的时间,观察是否可正常执行,可正常执行后再将时间调整至指定时间
网友评论