Connecting with Microsoft Powershell

Microsoft Powershell is an integrated command line shell for Microsoft Windows. Many elements of the .NET Framework can be used from within Powershell to connect to the Qlik Sense Repository Service (QRS) API.

The following example shows how to use Powershell to connect to the QRS API and retrieve a list of apps in JSON format. Since Microsoft Windows authentication is used in this example, the proxy URL is specified.

$req = New-Object System.Net.WebClient

$req.Credentials = [System.Net.CredentialCache]::DefaultCredentials

$req.QueryString.Add("xrfkey", "ABCDEFG123456789")

$req.Headers.Add("X-Qlik-xrfkey", "ABCDEFG123456789")

$req.DownloadString("http://servername.com/qrs/app")

Note: This example only works with GET requests. To enable POST requests, the example must be expanded. See Issuing POST commands via the proxy.

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?