Created
July 25, 2018 21:22
-
-
Save levi-turner/40ff7710a2f56f7f38cd16c8344c6e49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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