window计划任务执行powershell脚本

创建任务

首先按下 win + R 组合键,打开计划任务程序,创建基本任务

填写任务名称和描述

选择触发器

操作选择 启动程序

填写执行的程序powershell.exe

添加参数: -executionpolicy bypass -File “E:\study\ps1\tasks.ps1”
-File 后面的是需要执行的powershell脚本路径

点击完成