Windows Powershell“启动进程”未按计划任务运行

Windows Powershell“启动进程”未按计划任务运行,windows,powershell,powershell-2.0,Windows,Powershell,Powershell 2.0,有两个我从XP编辑的powershell脚本,在Win Server 2k8 R2中运行 当在powershell中手动执行时,它们运行良好,但如果以域管理员的身份调度和运行,它们将执行所有应该执行的文件操作;除非他们不执行启动过程,将文件发送到需要访问的SFTP站点 它们是通过运行powershell.exe启动的,其参数如下: -noprofile -ExecutionPolicy Bypass -file C:\Users\administrator\Documents\script1.p

有两个我从XP编辑的powershell脚本,在Win Server 2k8 R2中运行

当在powershell中手动执行时,它们运行良好,但如果以域管理员的身份调度和运行,它们将执行所有应该执行的文件操作;除非他们不执行启动过程,将文件发送到需要访问的SFTP站点

它们是通过运行powershell.exe启动的,其参数如下:

-noprofile -ExecutionPolicy Bypass -file C:\Users\administrator\Documents\script1.ps1
同样,正如我前面提到的,如果手动运行它们,它们运行良好,并根据请求启动启动进程,并且只有在计划文件操作并跳过启动进程时才运行文件操作

启动过程如下:

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"

我遗漏了什么?

添加一些代码以检查以确保流程已启动

$FileName = 'c:\test\test.txt';
$ArgumentList = "httpsu://www.securesiteexample.org/incoming/ $filename /prefNoAskSched /hidden /log /Remote-Site return /quitWhenDone";
$ExePath = 'c:\Program Files (x86)\Tumbleweed\STClient\stclient.exe';

$Process = Start-Process -FilePath $ExePath -ArgumentList $ArgumentList -PassThru;

# If $Process variable is null, then something went wrong ...
if (!$Process) {
    # Process did not start correctly! Write the most recent error to a file
    Add-Content -Path $env:windir\temp\sftp.log -Value $Error[0];
}

在您的任务中,转到“操作”窗格,从“开始”字段编辑并删除任何内容。

感谢您的提示,将其集成并作为powershell运行作业,工作正常,上载了文件。没有错误输出。按计划任务运行,四处移动文件未上载且无错误输出。所以我仍然感到困惑。在这场比赛中没有什么是在开始。只有powershell.exe程序/脚本,然后是上面发布的参数。