Skip to main content
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Unable to Execute Powershell Script from External Program Task

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. 

Labels (3)
4 Replies

This setup is running fine on my end:

  • Path: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
  • Parameters:  -ExecutionPolicy Bypass \\server\path\to\script.ps1

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.

Contributor III
Contributor III

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 


Contributor III
Contributor III

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.