Skip to content

Instantly share code, notes, and snippets.

@JustinGrote
Last active August 20, 2024 20:49
Show Gist options
  • Save JustinGrote/8c5f3347526086c06af37ce13c5713ee to your computer and use it in GitHub Desktop.
Save JustinGrote/8c5f3347526086c06af37ce13c5713ee to your computer and use it in GitHub Desktop.
UBreakIFix Monitor
function Watch-UBreakIFix ($TrackingCode) {
while ($true) {
$result = foreach ($code in $TrackingCode) {
$response = Invoke-RestMethod "https://www.ubreakifix.com/api/v1/tracker/info?code=$code"
$status = $response.work_orders.work_order_status
[PSCustomObject]@{
'Customer' = $response.customer.full_name
'Device' = $response.work_orders.device.device_type.name
'Fixer' = $response.user.email
'Status' = $status.name
'Next Update' = $status.next_time
'Next Update Type' = $status.estimated_update_label
}
}
cls
$result | ft -autosize
sleep 10
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment