任务调度程序上的Powershell脚本未运行 [英] Powershell script on task scheduler not running

查看:127
本文介绍了任务调度程序上的Powershell脚本未运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个可以传输文件的PS脚本,但是当我输入任务计划程序时,它说它运行成功,但它并没有真正运行。


这是我的程序/脚本声明:C:\ Windows \ System32 \ WindowsPowerShell \v1.0 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ NonInteractive -ExecutionPolicy Bypass -File" F:\ TEST \ TST \STU \DE \TransferScripts \DETransferPS.ps1"



我可以直接调用它并运行...




解决方案


为什么在创建power shell脚本时使用arguments语句,只需将程序/脚本的值等于.ps1文件位置。


请参考下面的脚本以供参考;



I've created a PS script which will transfer files, but when I put in on the Task Scheduler it says it runs successfully but it doesn't really run.

Here's my program/script statement:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add arguments statement: -NoProfile -NoLogo -NonInteractive -ExecutionPolicy Bypass -File "F:\TEST\TST\STU\DE\TransferScripts\DETransferPS.ps1"

I can call it directly and it runs...

解决方案

Hi,

Why are you using arguments statement when you have already created power shell script, simply put the value of program/script equal to your .ps1 file location.

Please refer below script shot for reference;


这篇关于任务调度程序上的Powershell脚本未运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆