From 94b8951dfdcf0c7a767212fc24396416de2e67f9 Mon Sep 17 00:00:00 2001 From: Robert van Bregt Date: Tue, 16 Feb 2021 17:54:53 +0100 Subject: [PATCH] Check localized status in taskbar overlay icon --- Get-TeamsStatus.ps1 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Get-TeamsStatus.ps1 b/Get-TeamsStatus.ps1 index 636da81..91a5372 100644 --- a/Get-TeamsStatus.ps1 +++ b/Get-TeamsStatus.ps1 @@ -30,8 +30,10 @@ $HAUrl = "" # Example: https://yourha.duckdns.org # Set language variables below $lgAvailable = "Available" $lgBusy = "Busy" +$lgOnThePhone = "On the phone" $lgAway = "Away" $lgDoNotDisturb = "Do not disturb" +$lgFocusing = "Focusing" $lgInAMeeting = "In a meeting" $lgOffline = "Offline" $lgNotInACall = "Not in a call" @@ -86,31 +88,31 @@ $TeamsProcess = Get-Process -Name Teams -ErrorAction SilentlyContinue # Check if Teams is running and start monitoring the log if it is If ($null -ne $TeamsProcess) { - If ($TeamsStatus -like "*Setting the taskbar overlay icon - Available*" -or ` + If ($TeamsStatus -like "*Setting the taskbar overlay icon - $lgAvailable*" -or ` $TeamsStatus -like "*StatusIndicatorStateService: Added Available*") { $Status = $lgAvailable Write-Host $Status } - ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Busy*" -or ` + ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - $lgBusy*" -or ` $TeamsStatus -like "*StatusIndicatorStateService: Added Busy*" -or ` - $TeamsStatus -like "*Setting the taskbar overlay icon - On the phone*" -or ` + $TeamsStatus -like "*Setting the taskbar overlay icon - $lgOnThePhone*" -or ` $TeamsStatus -like "*StatusIndicatorStateService: Added OnThePhone*") { $Status = $lgBusy Write-Host $Status } - ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Away*" -or ` + ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - $lgAway*" -or ` $TeamsStatus -like "*StatusIndicatorStateService: Added Away*") { $Status = $lgAway Write-Host $Status } - ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - Do not disturb *" -or ` + ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - $lgDoNotDisturb *" -or ` $TeamsStatus -like "*StatusIndicatorStateService: Added DoNotDisturb*" -or ` - $TeamsStatus -like "*Setting the taskbar overlay icon - Focusing*" -or ` + $TeamsStatus -like "*Setting the taskbar overlay icon - $lgFocusing*" -or ` $TeamsStatus -like "*StatusIndicatorStateService: Added Focusing*") { $Status = $lgDoNotDisturb Write-Host $Status } - ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - In a meeting*" -or ` + ElseIf ($TeamsStatus -like "*Setting the taskbar overlay icon - $lgInAMeeting*" -or ` $TeamsStatus -like "*StatusIndicatorStateService: Added InAMeeting*") { $Status = $lgInAMeeting Write-Host $Status