-
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 ==================================================
|
# === 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 `
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Get-ComputerInfo
|
Get-ComputerInfo | ConvertTo-Json
|
||||||
Loading…
Add table
Add a link
Reference in a new issue