有两个我从XP编辑的PowerShell脚本在Win Server 2k8 R2中运行。Powershell“启动过程”未按计划任务运行
它们在通过手动方式在powershell中执行时运行良好,但如果按照域管理员的计划和运行,它们将执行所有应该执行的文件操作;除非他们不会执行将文件发送到所需SFTP站点的启动进程。
他们用的参数运行powershell.exe这样展开:
-noprofile -ExecutionPolicy Bypass -file C:\Users\administrator\Documents\script1.ps1
同样,像我前面提到的,它们运行良好,并启动start-process
的要求,如果你手动运行它们,只能运行文件操作(如果它们已安排并跳过启动过程)。
的start-process
如下:
start-process -FilePath "c:\Program Files (x86)\Tumbleweed\STClient\stclient.exe" -ArgumentList "httpsu://www.securesiteexample.org/incoming/ $filename /prefNoAskSched /hidden /log /Remote-Site return /quitWhenDone"
我缺少什么?
感谢您的宝贵意见,将它集成并作为PowerShell运行,工作正常,上传文件。没有错误输出。按计划执行任务,移动文件周围没有上传并且没有错误输出。所以仍然令我困惑。 – user3546375