
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[QRS API] API Calls with Powershell
Hi,
On Dev Hub\Engine API there is an option to extract App Load Script using following request:
{
"handle": 1,
"method": "GetScript",
"params": {}
}
Response:
{
"jsonrpc": "2.0",
"id": 3,
"delta": true,
"result": {
"qScript": "///$tab Main\r\nSET ThousandSep=',';\r\nSET DecimalSep='.'; .....
}
}
My aim is to get list of all applications on server and extract load script for each of them into file.
So i'm interesting how to call same method using Powershell.
Does anybody know how to implement this?
- Tags:
- api
- qlik sense
- qrs
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the script posted on the following.
near the end there is a step that gets the script, modifies the script then puts it back on the server.
#Once we have the App we can Get the Load Script
$AppScript = $QEApp.GetScript()
if you remove modify and update steps you could just do something such as this to output it.
#Once we have the App we can Get the Load Script
$AppScript = $QEApp.GetScript()
$AppScript|out-file "C:\pathto\$($AppID)_script.txt"


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am curious whether others have solved for this. The crux of the issue is that the request to the Engine neither goes over QRS nor is it a RESTful call. It's a request over a websocket which there isn't native PowerShell support for. There are likely ways to accomplish this by using C# or .NET code but it would increase the complexity of the solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
You can do this with corectl
With corectl installed you can do the following:
corectl context create <name> --engine <QSEoW-URL>
corectl context use <name>
corectl context login (This will prompt you for your user credentials)
After that you should be able to validate that you've got it setup by running
corectl status (It should say something like "Connected without app.... ")
Now I'm not a PowerShell guru but I can give you the puzzle pieces, or rather, this is how I'd do it in shellscript:
for id in $(corectl app ls -q); do corectl --app $id script get > $id.qvs; done
"corectl app ls -q" will give you all the IDs of the apps. "corectl --app <APPID/APPNAME> script get" will give you the script of that specific file.
Hope this helps.
Cheers
- Tags:
- corectl

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply. I will check it ASAP. I have a lot of security restrictions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Find a solution to this? I have hundreds of dashboards that I need to retrieve the script from.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the script posted on the following.
near the end there is a step that gets the script, modifies the script then puts it back on the server.
#Once we have the App we can Get the Load Script
$AppScript = $QEApp.GetScript()
if you remove modify and update steps you could just do something such as this to output it.
#Once we have the App we can Get the Load Script
$AppScript = $QEApp.GetScript()
$AppScript|out-file "C:\pathto\$($AppID)_script.txt"
