Merge pull request #1 from metbril/patch-1

Improve readability
pull/8/head
EBOOZ 3 years ago committed by GitHub
commit 9369f1f161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,27 +25,45 @@ $Enable = 1
$CurrentStatus = "Offline"
DO {
# Get Teams Logfile and last icon overlay status
$TeamsStatus = Get-Content -Path "C:\Users\$UserName\AppData\Roaming\Microsoft\Teams\logs.txt" -Tail 100 | Select-String -Pattern 'Setting the taskbar overlay icon - Available','Setting the taskbar overlay icon - Busy','Setting the taskbar overlay icon - Away','Setting the taskbar overlay icon - Do not disturb','Main window is closing','main window closed','Setting the taskbar overlay icon - On the phone','Setting the taskbar overlay icon - In a meeting','StatusIndicatorStateService: Added Busy','StatusIndicatorStateService: Added Available','StatusIndicatorStateService: Added InAMeeting','StatusIndicatorStateService: Added DoNotDisturb','Setting the taskbar overlay icon - Focusing','StatusIndicatorStateService: Added Focusing' | Select-Object -Last 1
$TeamsStatus = Get-Content -Path "C:\Users\$UserName\AppData\Roaming\Microsoft\Teams\logs.txt" -Tail 100 | Select-String -Pattern `
'Setting the taskbar overlay icon -',`
'StatusIndicatorStateService: Added',`
'Main window is closing',`
'main window closed',`
| Select-Object -Last 1
# Get Teams Logfile and last app update deamon status
$TeamsActivity = Get-Content -Path "C:\Users\$UserName\AppData\Roaming\Microsoft\Teams\logs.txt" -Tail 100 | Select-String -Pattern 'Resuming daemon App updates','Pausing daemon App updates','SfB:TeamsNoCall','SfB:TeamsPendingCall','SfB:TeamsActiveCall' | Select-Object -Last 1
$TeamsActivity = Get-Content -Path "C:\Users\$UserName\AppData\Roaming\Microsoft\Teams\logs.txt" -Tail 100 | Select-String -Pattern `
'Resuming daemon App updates',`
'Pausing daemon App updates',`
'SfB:TeamsNoCall',`
'SfB:TeamsPendingCall',`
'SfB:TeamsActiveCall' | Select-Object -Last 1
If ($TeamsStatus -like "*Setting the taskbar overlay icon - Available*" -or $TeamsStatus -like "*StatusIndicatorStateService: Added Available*") {
If ($TeamsStatus -like "*Setting the taskbar overlay icon - Available*" -or `
$TeamsStatus -like "*StatusIndicatorStateService: Added Available*") {
$Status = "Available"
Write-Host $Status
}
ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Busy*" -or $TeamsStatus -like "*StatusIndicatorStateService: Added Busy*" -or $TeamsStatus -like "*Setting the taskbar overlay icon - On the phone*") {
ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Busy*" -or `
$TeamsStatus -like "*StatusIndicatorStateService: Added Busy*" -or `
$TeamsStatus -like "*Setting the taskbar overlay icon - On the phone*") {
$Status = "Busy"
Write-Host $Status
}
ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Away*" -or $TeamsStatus -like "*StatusIndicatorStateService: Added Away*") {
ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Away*" -or `
$TeamsStatus -like "*StatusIndicatorStateService: Added Away*") {
$Status = "Away"
Write-Host $Status
}
ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Do not disturb *" -or $TeamsStatus -like "*StatusIndicatorStateService: Added DoNotDisturb*" -or $TeamsStatus -like "*Setting the taskbar overlay icon - Focusing*" -or $TeamsStatus -like "*StatusIndicatorStateService: Added Focusing*") {
ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Do not disturb *" -or `
$TeamsStatus -like "*StatusIndicatorStateService: Added DoNotDisturb*" -or `
$TeamsStatus -like "*Setting the taskbar overlay icon - Focusing*" -or `
$TeamsStatus -like "*StatusIndicatorStateService: Added Focusing*") {
$Status = "Do not disturb"
Write-Host $Status
}
ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - In a meeting*" -or $TeamsStatus -like "*StatusIndicatorStateService: Added InAMeeting*") {
ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - In a meeting*" -or `
$TeamsStatus -like "*StatusIndicatorStateService: Added InAMeeting*") {
$Status = "In a meeting"
Write-Host $Status
}
@ -54,12 +72,14 @@ ElseIf ($TeamsStatus -like "*ain window*") {
Write-Host $Status
}
If ($TeamsActivity -like "*Resuming daemon App updates*" -or $TeamsActivity -like "*SfB:TeamsNoCall*") {
If ($TeamsActivity -like "*Resuming daemon App updates*" -or `
$TeamsActivity -like "*SfB:TeamsNoCall*") {
$Activity = "Not in a call"
$ActivityIcon = "mdi:phone-off"
Write-Host $Activity
}
ElseIf ($TeamsActivity -like "*Pausing daemon App updates*" -or $TeamsActivity -like "*SfB:TeamsActiveCall*") {
ElseIf ($TeamsActivity -like "*Pausing daemon App updates*" -or `
$TeamsActivity -like "*SfB:TeamsActiveCall*") {
$Activity = "In a call"
$ActivityIcon = "mdi:phone-in-talk-outline"
Write-Host $Activity

Loading…
Cancel
Save