-
This commit is contained in:
parent
84dadb678f
commit
13ba38d190
2 changed files with 6 additions and 7 deletions
11
cleanup.ps1
11
cleanup.ps1
|
|
@ -60,7 +60,7 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
|
|||
# === RUN REMOTE SCRIPT ==================================================
|
||||
Write-Host "Fetching data from remote script..."
|
||||
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)"
|
||||
}
|
||||
catch {
|
||||
|
|
@ -69,11 +69,10 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
|
|||
}
|
||||
|
||||
# === SEND TO WEBHOOK ====================================================
|
||||
try {
|
||||
$payload = @{
|
||||
remoteData = $remoteData
|
||||
ticket = $ticket
|
||||
} | ConvertTo-Json -Compress
|
||||
$payload = @{
|
||||
ticket = $ticket
|
||||
remoteData = $remoteData
|
||||
} | ConvertTo-Json -Compress
|
||||
|
||||
$response = Invoke-RestMethod -Uri $WebhookURL -Method Post `
|
||||
-Body $payload `
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue