just need to test the data that gets sent to this script
This commit is contained in:
@@ -1,31 +1,21 @@
|
|||||||
# Eval the alert data
|
# Eval the alert data
|
||||||
If ( -not $AlertData ) { Write-Error "No alert data provided" ; Return }
|
If ( -not $AlertData ) { Write-Error "No alert data provided" ; Return } Else { Write-Output $AlertData ; Return }
|
||||||
|
|
||||||
# Create ticket
|
## Create ticket
|
||||||
Import-Module $env:SyncroModule -WarningAction SilentlyContinue
|
#New-RMMTicket -Subject "App Crash on ${Env:COMPUTERNAME}" -InitialIssue "Application crash detected. Reason for crash indicates a Windows component is at fault."
|
||||||
$TicketSubject = 'App Crash on ' + $Env:COMPUTERNAME
|
#
|
||||||
$TicketIssueType = 'Remote Support'
|
## Update the ticket
|
||||||
$TicketStatus = 'New'
|
#$TicketComment = "It looks like an app crashed on your computer, and the reason for the crash indicates a Windows component is at fault.`n`nI'll repair your system now."
|
||||||
Try {
|
#Create-Syncro-Ticket-Comment -TicketIdOrNumber $TicketID -Subject "Update" -Body $TicketComment -Hidden $false -DoNotEmail $false
|
||||||
$TicketData = Create-Syncro-Ticket -Subject $TicketSubject -IssueType $TicketIssueType -Status $TicketStatus
|
#
|
||||||
$TicketID = $TicketData.ticket.id
|
## Bill time to the ticket
|
||||||
$TicketComment = "Application crash detected. Reason for crash indicates a Windows component is at fault."
|
#$BillableTimeInMinutes = 15
|
||||||
Create-Syncro-Ticket-Comment -TicketIdOrNumber $TicketID -Subject "Issue" -Body $TicketComment -Hidden $true -DoNotEmail $true
|
#$StartAt = (Get-Date).AddMinutes(-$BillableTimeInMinutes).ToString("o")
|
||||||
}
|
#$TimeEntryNote = "Analysis indicates crash caused by Windows component(s). Scanning and repairing corruption in the system."
|
||||||
Catch { Write-Error "Error creating ticket" ; Return }
|
#Create-Syncro-Ticket-TimerEntry -TicketIdOrNumber $TicketID -StartTime $StartAt -DurationMinutes $BillableTimeInMinutes -Notes $TimeEntryNote -UserIdOrEmail $TimeAttributedToUser -ChargeTime "true"
|
||||||
|
#
|
||||||
# Update the ticket
|
## Fix Windows Health
|
||||||
$TicketComment = "It looks like an app crashed on your computer, and the reason for the crash indicates a Windows component is at fault.`n`nI'll repair your system now."
|
#$FixWindowsHealth = Download-File -URL 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Fix-WindowsHealth.ps1'
|
||||||
Create-Syncro-Ticket-Comment -TicketIdOrNumber $TicketID -Subject "Update" -Body $TicketComment -Hidden $false -DoNotEmail $false
|
#. $FixWindowsHealth
|
||||||
|
#If ( Test-Path $FixWindowsHealth ) { Remove-Item $FixWindowsHealth -Force -ErrorAction SilentlyContinue }
|
||||||
# Bill time to the ticket
|
|
||||||
$BillableTimeInMinutes = 15
|
|
||||||
$StartAt = (Get-Date).AddMinutes(-$BillableTimeInMinutes).ToString("o")
|
|
||||||
$TimeEntryNote = "Analysis indicates crash caused by Windows component(s). Scanning and repairing corruption in the system."
|
|
||||||
Create-Syncro-Ticket-TimerEntry -TicketIdOrNumber $TicketID -StartTime $StartAt -DurationMinutes $BillableTimeInMinutes -Notes $TimeEntryNote -UserIdOrEmail $TimeAttributedToUser -ChargeTime "true"
|
|
||||||
|
|
||||||
# Fix Windows Health
|
|
||||||
$FixWindowsHealth = Download-File -URL 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Fix-WindowsHealth.ps1'
|
|
||||||
. $FixWindowsHealth
|
|
||||||
If ( Test-Path $FixWindowsHealth ) { Remove-Item $FixWindowsHealth -Force -ErrorAction SilentlyContinue }
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user