diff --git a/main.ps1 b/main.ps1 index 38be37b..9f98f28 100644 --- a/main.ps1 +++ b/main.ps1 @@ -106,10 +106,22 @@ $CyberQPBox.IsEnabled = $false $AutotaskBox.Add_Checked({ $PhoneBox.Visibility = 'Visible' + $websiteBox.Visibility = 'Visible' + $streetBox.Visibility = 'Visible' + $cityBox.Visibility = 'Visible' + $provinceBox.Visibility = 'Visible' + $postalCodeBox.Visibility = 'Visible' + $countryBox.Visibility = 'Visible' }) $AutotaskBox.Add_Unchecked({ $PhoneBox.Visibility = 'Collapsed' + $websiteBox.Visibility = 'Collapsed' + $streetBox.Visibility = 'Collapsed' + $cityBox.Visibility = 'Collapsed' + $provinceBox.Visibility = 'Collapsed' + $postalCodeBox.Visibility = 'Collapsed' + $countryBox.Visibility = 'Collapsed' }) $Pax8Box.Add_Checked({ @@ -220,10 +232,6 @@ $SubmitBtn.Add_Click({ $StatusBlock.Text = "" Write-Host "[SUBMIT] Provisioning start" - Write-Host "[DEBUG] Company: $company" - Write-Host "[DEBUG] Phone: $phone" - Write-Host "[DEBUG] Autotask selected: $($AutotaskBox.IsChecked)" - Write-Host "[DEBUG] Datto selected: $($DattoBox.IsChecked)" Write-Host "[DEBUG] Tool Credentials: $($script:toolCredentials | ConvertTo-Json -Depth 4)" if (-not $company) { @@ -259,7 +267,21 @@ $SubmitBtn.Add_Click({ Write-Host "[SUCCESS] Provisioning complete." $CompanyNameBox.Text = "" $PhoneBox.Text = "" + $WebsiteBox.Text = "" + $StreetBox.Text = "" + $CountryBox.Text = "" + $CityBox.Text = "" + $ProvinceBox.Text = "" + $PostalCodeBox.Text = "" + $SelectAllBox.IsChecked = $false + $AutotaskBox.IsChecked = $false + $DattoBox.IsChecked = $false + $ITGlueBox.IsChecked = $false + $BackupBox.IsChecked = $false + $RocketcyberBox.IsChecked = $false + $CyberQPBox.IsChecked = $false + $Pax8Box.IsChecked = $false } catch { Write-Host "[ERROR] Provisioning failed: $($_.Exception.Message)" diff --git a/tools/autotask.ps1 b/tools/autotask.ps1 index 32e12b9..819d64b 100644 --- a/tools/autotask.ps1 +++ b/tools/autotask.ps1 @@ -33,8 +33,7 @@ function Invoke-AutotaskProvision { try { $Response = Invoke-RestMethod -Uri $Url -Method Post -Headers $Headers -Body $Body - $CompanyID = $Response.itemId, $Response.id, $Response.companyID, $Response.item.id | Where-Object { $_ } | Select-Object -First 1 - [System.Windows.MessageBox]::Show("Autotask company created with ID: $CompanyID", "Autotask") + $Response.itemId, $Response.id, $Response.companyID, $Response.item.id | Where-Object { $_ } | Select-Object -First 1 } catch { throw "[Autotask] Provisioning failed: $($_.Exception.Message)" } diff --git a/tools/dattormm.ps1 b/tools/dattormm.ps1 index 1b76d5b..a21782f 100644 --- a/tools/dattormm.ps1 +++ b/tools/dattormm.ps1 @@ -47,8 +47,7 @@ $TokenResponse = Invoke-RestMethod -Uri $TokenUrl -Method Post -Headers $TokenHe $SiteBody = @{ name = $CompanyName } | ConvertTo-Json -Depth 3 try { - $SiteResponse = Invoke-RestMethod -Uri $SiteUrl -Method Put -Headers $SiteHeaders -Body $SiteBody - [System.Windows.MessageBox]::Show("Datto RMM site created: $CompanyName", "Datto RMM") + Invoke-RestMethod -Uri $SiteUrl -Method Put -Headers $SiteHeaders -Body $SiteBody } catch { throw "[Datto] Site creation failed: $($_.Exception.Message)" } diff --git a/tools/pax8.ps1 b/tools/pax8.ps1 index 6423cbc..9092c02 100644 --- a/tools/pax8.ps1 +++ b/tools/pax8.ps1 @@ -60,8 +60,8 @@ function Invoke-Pax8Provision { phone = $Phone website = $Website externalId = "" - billOnBehalfOfEnabled = $true - selfServiceAllowed = $true + billOnBehalfOfEnabled = $false + selfServiceAllowed = $false orderApprovalRequired = $false address = @{ street = $Street