我已经创建了一个可以传输文件的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 myprogram/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 ofprogram/script equal to your .ps1 file location.
Please refer below script shot for reference;
更多推荐
任务调度程序上的Powershell脚本未运行
发布评论