Changed script
This commit is contained in:
parent
12952dd14e
commit
574bc22a9b
1 changed files with 6 additions and 5 deletions
11
cleanup.ps1
11
cleanup.ps1
|
|
@ -1,14 +1,15 @@
|
|||
$ScriptTitle = "Quest Computers Cleanup"
|
||||
$WebhookURL = "https://n8n.questcomputers.be/webhook-test/8fde21e2-937f-4142-b983-6e1606e29335"
|
||||
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
|
||||
# ---- Create the form -------------------------------------------------------
|
||||
$form = New-Object System.Windows.Forms.Form
|
||||
$form.Text = "Ticket Number"
|
||||
$form.Text = $ScriptTitle
|
||||
$form.Size = New-Object System.Drawing.Size(320, 160)
|
||||
$form.StartPosition = "CenterScreen"
|
||||
$form.Topmost = $true
|
||||
$form.KeyPreview = $true # let the form see keys
|
||||
$form.KeyPreview = $true
|
||||
|
||||
# ---- Label ---------------------------------------------------------------
|
||||
$lbl = New-Object System.Windows.Forms.Label
|
||||
|
|
@ -51,7 +52,7 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
|
|||
$ticket = $txt.Text.Trim()
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($ticket)) {
|
||||
Write-Host "Empty ticket – aborting."
|
||||
Write-Host "Empty ticket - aborting."
|
||||
exit
|
||||
}
|
||||
|
||||
|
|
@ -64,11 +65,11 @@ if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
|
|||
-ContentType "application/json" `
|
||||
-ErrorAction Stop
|
||||
|
||||
Write-Host "✅ Ticket $ticket sent successfully."
|
||||
Write-Host "Ticket $ticket sent successfully."
|
||||
Write-Host "Webhook response:`n$($response | ConvertTo-Json -Compress)"
|
||||
}
|
||||
catch {
|
||||
Write-Error "❌ Failed to send ticket: $_"
|
||||
Write-Error "Failed to send ticket: $_"
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue