Last active
August 20, 2024 20:49
-
-
Save JustinGrote/8c5f3347526086c06af37ce13c5713ee to your computer and use it in GitHub Desktop.
UBreakIFix Monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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