Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I have a PowerShell script that uses Qlik CLI to generate the File IDs of QVDs from SaaS and store it onto a text file. This Shell script works when I run it manually on the host server but unable to execute it through Qlik Sense for Windows' External Program Task even though the result says success.
The Following is the Qlik CLI Script which works -
qlik data-file ls --connectionId 4a6e016f-b3db-4301-a934-4cdce133cdfb --limit 500| ConvertFrom-Json | Format-Table id, name > \\QLK-ANA-PUE-001\QlikSenseAppData\BatchScripts\DA-Load\File-Id.txt
The Following is the External Program Task:
Path: powershell.exe
Parameters: -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""\\qlk-ana-pue-001\QlikSenseAppData\BatchScripts\DA-Load\Run_Generate.ps1""' -Verb RunAs}"
Please help in debugging this issue.
Thanks,
Aslam
This setup is running fine on my end:
I will note that in your example, do be sure that the qlik-cli is in the Path for whatever server(s) is running the command.
The File is on the server 001, the scheduler hosts are 001 and 002. It looks like the task fails when its triggered through 002, even though 002 also has Qlik-CLI in its Environment Variable Path.
when you call the qlik executable. you need to make sure that there is a copy that is accessible to all nodes. and fully qualify the path.
e.g. your script is here \\qlk-ana-pue-001\QlikSenseAppData\BatchScripts\DA-Load\Run_Generate.ps1
so try putting Qlik.exe in the share then referencing it in your ps1 like
& \\qlk-ana-pue-001\QlikSenseAppData\BatchScripts\qlik.exe
Hi Everyone,
Thank you for your inputs on this.
I got it to work by using the actual path of the file on the host server instead of the network path. i.e, -NoProfile -ExecutionPolicy Bypass "D:\QlikSenseAppData\BatchScripts\DA-Load\Run_Generate.ps1".
I just have two maintain the same set of files on two different hosts now for both the nodes to run the task with the absolute path.