From d100c67b346dd78c0cecb3a48ccabb2325e8be62 Mon Sep 17 00:00:00 2001 From: anonyme22 <32210368+anonyme22@users.noreply.github.com> Date: Sun, 11 Apr 2021 14:25:23 -0400 Subject: [PATCH 1/2] Update Get-TeamsStatus.ps1 Change "C:\Users\$UserName\AppData\Roaming" by environnement variable @env:APPDATA --- Get-TeamsStatus.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Get-TeamsStatus.ps1 b/Get-TeamsStatus.ps1 index 71d4959..9aa4180 100644 --- a/Get-TeamsStatus.ps1 +++ b/Get-TeamsStatus.ps1 @@ -19,6 +19,12 @@ directly from the commandline. .EXAMPLE .\Get-TeamsStatus.ps1 -SetStatus "Offline" + +.VERSION HISTORY +... +2021-04-01 by anoyme22: + Change "C:\Users\$UserName\AppData\Roaming" by environnement variable @env:APPDATA + #> # Configuring parameter for interactive run Param($SetStatus) @@ -48,12 +54,12 @@ If($null -ne $SetStatus){ # Start monitoring the Teams logfile when no parameter is used to run the script DO { # Get Teams Logfile and last icon overlay status -$TeamsStatus = Get-Content -Path "C:\Users\$UserName\AppData\Roaming\Microsoft\Teams\logs.txt" -Tail 1000 | Select-String -Pattern ` +$TeamsStatus = Get-Content -Path $env:APPDATA"\Microsoft\Teams\logs.txt" -Tail 1000 | Select-String -Pattern ` 'Setting the taskbar overlay icon -',` 'StatusIndicatorStateService: Added' | 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 1000 | Select-String -Pattern ` +$TeamsActivity = Get-Content -Path $env:APPDATA"\Microsoft\Teams\logs.txt" -Tail 1000 | Select-String -Pattern ` 'Resuming daemon App updates',` 'Pausing daemon App updates',` 'SfB:TeamsNoCall',` @@ -178,4 +184,4 @@ If ($CurrentActivity -ne $Activity) { Invoke-RestMethod -Uri "$HAUrl/api/states/$entityActivity" -Method POST -Headers $headers -Body ([System.Text.Encoding]::UTF8.GetBytes($params)) -ContentType "application/json" } Start-Sleep 1 -} Until ($Enable -eq 0) \ No newline at end of file +} Until ($Enable -eq 0) From 13b3299aa0afbbfae596dbffed512fc5040aa20d Mon Sep 17 00:00:00 2001 From: EBOOZ Date: Wed, 21 Apr 2021 14:21:26 +0200 Subject: [PATCH 2/2] Update Get-TeamsStatus.ps1 That I didn't think of that variable before :) Thanks for you contribution! --- Get-TeamsStatus.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Get-TeamsStatus.ps1 b/Get-TeamsStatus.ps1 index 9aa4180..1c4da75 100644 --- a/Get-TeamsStatus.ps1 +++ b/Get-TeamsStatus.ps1 @@ -19,12 +19,6 @@ directly from the commandline. .EXAMPLE .\Get-TeamsStatus.ps1 -SetStatus "Offline" - -.VERSION HISTORY -... -2021-04-01 by anoyme22: - Change "C:\Users\$UserName\AppData\Roaming" by environnement variable @env:APPDATA - #> # Configuring parameter for interactive run Param($SetStatus)