【问题标题】:How do I schedule this .ps1 file to run daily?如何安排此 .ps1 文件每天运行?
【发布时间】:2019-06-26 06:23:47
【问题描述】:

我有一个 .ps1 文件,当我在 PowerShell 中运行它时它可以工作(它注册了一个文件系统观察器来观察 excel 文件中的变化),但是当我在任务调度程序中安排它时我无法让它工作。

这是因为我的输入已关闭,还是我需要将此 .ps1 导出到其他文件中?

我的意见-

程序 = PowerShell.exe

添加参数 = -ExecutionPolicy Bypass \blah blah blah\testing file.ps1

起点为空

【问题讨论】:

  • 应该可以,开始在 PS 脚本中记录一些检查点以进一步查看

标签: powershell scheduled-tasks taskscheduler


【解决方案1】:

试试这个:

动作:启动程序

程序:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

参数:-ExecutionPolicy Bypass -file "\blah blah blah\testing file.ps1"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-19
    • 1970-01-01
    • 2011-07-25
    • 2016-11-24
    • 2015-07-01
    相关资源
    最近更新 更多