-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCall-HealthCheck.ps1
More file actions
30 lines (21 loc) · 948 Bytes
/
Call-HealthCheck.ps1
File metadata and controls
30 lines (21 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<#
This script calls the Evolve Generate Healthcheck API.
You need to have a valid settings file and json* file for this script to work
This script is tested in PowerShell Core 7
#>
## initialise script
$configFile = ".\settings.json"
$conf = Get-Content $configFile | ConvertFrom-Json
## initialise http request
$uri = $conf.env.baseUrl + $conf.app.generate + "/appHealth"
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Bearer " + $conf.env.bearerToken)
$body = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$body.Add("application", "GenerateBatch")
## Execute http request
$response = Invoke-RestMethod $uri -Method 'POST' -Headers $headers -Body ($body | ConvertTo-Json)
Write-Output $response | Format-List
# Pause
#Read-Host "Press Enter to continue..."