任务调度程序上的Powershell脚本未运行

编程入门 行业动态 更新时间:2024-10-12 03:25:55
本文介绍了任务调度程序上的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 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脚本未运行

本文发布于:2023-11-25 13:02:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629859.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   程序   Powershell

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!