从Azure WebJob的run.ps1运行exe

时间:2018-01-08 07:03:33

标签: powershell azure azure-webjobs azureportal

我正在尝试在Azure门户中进行部署。部署完成后,它将以powershell脚本启动,该脚本将启动位于同一目录中的可执行文件

run.ps1(脚本)的内容

& ScrapperProcessor.exe

其中“ScrapperProcessor.exe”是可执行文件的名称。

“run.ps1”和“ScrapperProcessor.exe”的父文件夹名为“Debug”

我得到以下日志:

[01/08/2018 06:27:52 > f328c1: SYS INFO] Status changed to Initializing
[01/08/2018 06:27:58 > f328c1: SYS INFO] Run script 'run.ps1' with script host - 'PowerShellScriptHost'
[01/08/2018 06:27:58 > f328c1: SYS INFO] Status changed to Running
[01/08/2018 06:28:07 > f328c1: ERR ] & : The term 'ScrapperProcessor.exe' is not recognized as the name of a 
[01/08/2018 06:28:07 > f328c1: ERR ] cmdlet, function, script file, or operable program. Check the spelling of the 
[01/08/2018 06:28:07 > f328c1: ERR ] name, or if a path was included, verify that the path is correct and try again.
[01/08/2018 06:28:07 > f328c1: ERR ] At D:\local\Temp\jobs\triggered\Scr7\xbs0kgzn.2e4\Debug\run.ps1:1 char:3
[01/08/2018 06:28:07 > f328c1: ERR ] + & ScrapperProcessor.exe
[01/08/2018 06:28:07 > f328c1: ERR ] +   ~~~~~~~~~~~~~~~~~~~~~
[01/08/2018 06:28:07 > f328c1: ERR ]     + CategoryInfo          : ObjectNotFound: (ScrapperProcessor.exe:String) [ 
[01/08/2018 06:28:07 > f328c1: ERR ]    ], CommandNotFoundException
[01/08/2018 06:28:07 > f328c1: ERR ]     + FullyQualifiedErrorId : CommandNotFoundException
[01/08/2018 06:28:07 > f328c1: ERR ]  
[01/08/2018 06:28:07 > f328c1: SYS INFO] Status changed to Success

知道为什么这不起作用吗?

1 个答案:

答案 0 :(得分:0)

您只需要更改:

& ScrapperProcessor.exe

& .\ScrapperProcessor.exe