Fix replies
This commit is contained in:
30
main.ps1
30
main.ps1
@@ -106,10 +106,22 @@ $CyberQPBox.IsEnabled = $false
|
|||||||
|
|
||||||
$AutotaskBox.Add_Checked({
|
$AutotaskBox.Add_Checked({
|
||||||
$PhoneBox.Visibility = 'Visible'
|
$PhoneBox.Visibility = 'Visible'
|
||||||
|
$websiteBox.Visibility = 'Visible'
|
||||||
|
$streetBox.Visibility = 'Visible'
|
||||||
|
$cityBox.Visibility = 'Visible'
|
||||||
|
$provinceBox.Visibility = 'Visible'
|
||||||
|
$postalCodeBox.Visibility = 'Visible'
|
||||||
|
$countryBox.Visibility = 'Visible'
|
||||||
})
|
})
|
||||||
|
|
||||||
$AutotaskBox.Add_Unchecked({
|
$AutotaskBox.Add_Unchecked({
|
||||||
$PhoneBox.Visibility = 'Collapsed'
|
$PhoneBox.Visibility = 'Collapsed'
|
||||||
|
$websiteBox.Visibility = 'Collapsed'
|
||||||
|
$streetBox.Visibility = 'Collapsed'
|
||||||
|
$cityBox.Visibility = 'Collapsed'
|
||||||
|
$provinceBox.Visibility = 'Collapsed'
|
||||||
|
$postalCodeBox.Visibility = 'Collapsed'
|
||||||
|
$countryBox.Visibility = 'Collapsed'
|
||||||
})
|
})
|
||||||
|
|
||||||
$Pax8Box.Add_Checked({
|
$Pax8Box.Add_Checked({
|
||||||
@@ -220,10 +232,6 @@ $SubmitBtn.Add_Click({
|
|||||||
$StatusBlock.Text = ""
|
$StatusBlock.Text = ""
|
||||||
|
|
||||||
Write-Host "[SUBMIT] Provisioning start"
|
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)"
|
Write-Host "[DEBUG] Tool Credentials: $($script:toolCredentials | ConvertTo-Json -Depth 4)"
|
||||||
|
|
||||||
if (-not $company) {
|
if (-not $company) {
|
||||||
@@ -259,7 +267,21 @@ $SubmitBtn.Add_Click({
|
|||||||
Write-Host "[SUCCESS] Provisioning complete."
|
Write-Host "[SUCCESS] Provisioning complete."
|
||||||
$CompanyNameBox.Text = ""
|
$CompanyNameBox.Text = ""
|
||||||
$PhoneBox.Text = ""
|
$PhoneBox.Text = ""
|
||||||
|
$WebsiteBox.Text = ""
|
||||||
|
$StreetBox.Text = ""
|
||||||
|
$CountryBox.Text = ""
|
||||||
|
$CityBox.Text = ""
|
||||||
|
$ProvinceBox.Text = ""
|
||||||
|
$PostalCodeBox.Text = ""
|
||||||
|
|
||||||
$SelectAllBox.IsChecked = $false
|
$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 {
|
catch {
|
||||||
Write-Host "[ERROR] Provisioning failed: $($_.Exception.Message)"
|
Write-Host "[ERROR] Provisioning failed: $($_.Exception.Message)"
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ function Invoke-AutotaskProvision {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$Response = Invoke-RestMethod -Uri $Url -Method Post -Headers $Headers -Body $Body
|
$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
|
$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")
|
|
||||||
} catch {
|
} catch {
|
||||||
throw "[Autotask] Provisioning failed: $($_.Exception.Message)"
|
throw "[Autotask] Provisioning failed: $($_.Exception.Message)"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,7 @@ $TokenResponse = Invoke-RestMethod -Uri $TokenUrl -Method Post -Headers $TokenHe
|
|||||||
$SiteBody = @{ name = $CompanyName } | ConvertTo-Json -Depth 3
|
$SiteBody = @{ name = $CompanyName } | ConvertTo-Json -Depth 3
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$SiteResponse = Invoke-RestMethod -Uri $SiteUrl -Method Put -Headers $SiteHeaders -Body $SiteBody
|
Invoke-RestMethod -Uri $SiteUrl -Method Put -Headers $SiteHeaders -Body $SiteBody
|
||||||
[System.Windows.MessageBox]::Show("Datto RMM site created: $CompanyName", "Datto RMM")
|
|
||||||
} catch {
|
} catch {
|
||||||
throw "[Datto] Site creation failed: $($_.Exception.Message)"
|
throw "[Datto] Site creation failed: $($_.Exception.Message)"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ function Invoke-Pax8Provision {
|
|||||||
phone = $Phone
|
phone = $Phone
|
||||||
website = $Website
|
website = $Website
|
||||||
externalId = ""
|
externalId = ""
|
||||||
billOnBehalfOfEnabled = $true
|
billOnBehalfOfEnabled = $false
|
||||||
selfServiceAllowed = $true
|
selfServiceAllowed = $false
|
||||||
orderApprovalRequired = $false
|
orderApprovalRequired = $false
|
||||||
address = @{
|
address = @{
|
||||||
street = $Street
|
street = $Street
|
||||||
|
|||||||
Reference in New Issue
Block a user