18 lines
374 B
PowerShell
18 lines
374 B
PowerShell
|
|
$body = @{
|
||
|
|
event = "random_event"
|
||
|
|
version = "0.1.0"
|
||
|
|
platform = "windows"
|
||
|
|
} | ConvertTo-Json -Compress
|
||
|
|
|
||
|
|
try {
|
||
|
|
Invoke-RestMethod `
|
||
|
|
-Method Post `
|
||
|
|
-Uri "http://localhost:8080/telemetry/ping" `
|
||
|
|
-ContentType "application/json" `
|
||
|
|
-Body $body
|
||
|
|
}
|
||
|
|
catch {
|
||
|
|
Write-Host "Expected error received:"
|
||
|
|
Write-Host $_.Exception.Message
|
||
|
|
}
|