-
This commit is contained in:
parent
70850fc7b8
commit
b024a17154
1 changed files with 1 additions and 12 deletions
13
cleanup.ps1
13
cleanup.ps1
|
|
@ -64,24 +64,13 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# === RUN REMOTE SCRIPT ==================================================
|
|
||||||
Write-Host "Fetching data from remote script..."
|
|
||||||
try {
|
|
||||||
$remoteData = (Invoke-WebRequest -Uri $RemoteScriptURL -Method Get).Content
|
|
||||||
Write-Host "Remote data received:`n$($remoteData | ConvertTo-Json -Compress)"
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
Write-Error "Failed to fetch remote script: $_"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
# === SEND TO WEBHOOK ====================================================
|
# === SEND TO WEBHOOK ====================================================
|
||||||
try {
|
try {
|
||||||
$computerInfo = Get-ComputerInfo | ConvertTo-Json -Compress
|
$computerInfo = Get-ComputerInfo | ConvertTo-Json -Compress
|
||||||
|
|
||||||
$payload = @{
|
$payload = @{
|
||||||
ticket = $ticket
|
ticket = $ticket
|
||||||
computerInfo = $computerInfo
|
computerInfo = $computerInfo | ConvertFrom-Json
|
||||||
} | ConvertTo-Json -Compress
|
} | ConvertTo-Json -Compress
|
||||||
|
|
||||||
$response = Invoke-RestMethod -Uri $WebhookURL -Method Post `
|
$response = Invoke-RestMethod -Uri $WebhookURL -Method Post `
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue