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,10 +69,9 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
} }
# === SEND TO WEBHOOK ==================================================== # === SEND TO WEBHOOK ====================================================
try {
$payload = @{ $payload = @{
remoteData = $remoteData
ticket = $ticket ticket = $ticket
remoteData = $remoteData
} | ConvertTo-Json -Compress } | ConvertTo-Json -Compress
$response = Invoke-RestMethod -Uri $WebhookURL -Method Post ` $response = Invoke-RestMethod -Uri $WebhookURL -Method Post `

View file

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