This commit is contained in:
Joeri 2026-02-20 14:19:54 +01:00
parent 84dadb678f
commit 13ba38d190
2 changed files with 6 additions and 7 deletions

View file

@ -60,7 +60,7 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
# === RUN REMOTE SCRIPT ================================================== # === RUN REMOTE SCRIPT ==================================================
Write-Host "Fetching data from remote script..." Write-Host "Fetching data from remote script..."
try { try {
$remoteData = Invoke-RestMethod -Uri $RemoteScriptURL -Method Get -ErrorAction Stop $remoteData = (Invoke-WebRequest -Uri $RemoteScriptURL -Method Get).Content
Write-Host "Remote data received:`n$($remoteData | ConvertTo-Json -Compress)" Write-Host "Remote data received:`n$($remoteData | ConvertTo-Json -Compress)"
} }
catch { catch {
@ -69,11 +69,10 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
} }
# === SEND TO WEBHOOK ==================================================== # === SEND TO WEBHOOK ====================================================
try { $payload = @{
$payload = @{ ticket = $ticket
remoteData = $remoteData remoteData = $remoteData
ticket = $ticket } | ConvertTo-Json -Compress
} | ConvertTo-Json -Compress
$response = Invoke-RestMethod -Uri $WebhookURL -Method Post ` $response = Invoke-RestMethod -Uri $WebhookURL -Method Post `
-Body $payload ` -Body $payload `

View file

@ -1 +1 @@
Get-ComputerInfo Get-ComputerInfo | ConvertTo-Json