Skip to content

Instantly share code, notes, and snippets.

@levi-turner
Created July 25, 2018 21:22
Show Gist options
  • Save levi-turner/40ff7710a2f56f7f38cd16c8344c6e49 to your computer and use it in GitHub Desktop.
Save levi-turner/40ff7710a2f56f7f38cd16c8344c6e49 to your computer and use it in GitHub Desktop.
$hdrs = @{}
$hdrs.Add("X-Qlik-Xrfkey","examplexrfkey123")
$hdrs.Add("X-Qlik-User", "UserDirectory=INTERNAL; UserId=sa_api")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$Data = Get-Content C:\ProgramData\Qlik\Sense\Host.cfg
$FQDN = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($($Data)))
$qpsalive = 0
Do {
if($qpsalive.value -eq "True") {"Repository Initialized"}
else{
Write-Host "Repository Still Initializing" -ForegroundColor Green
start-sleep 5
$ProgressPreference = "SilentlyContinue"
$qpsalive = Invoke-RestMethod -Uri "https://$($FQDN):4243/qps/alive?xrfkey=examplexrfkey123" -Method Get -Headers $hdrs -ContentType 'application/json' -Certificate $cert
}
}
Until($qpsalive.value -eq "True")
Connect-Qlik -computername $($FQDN) -UseDefaultCredentials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment