Merge pull request #28 from anonyme22/main

Replace hard coded appdata directory for environment variable
pull/34/head
EBOOZ 4 years ago committed by GitHub
commit b3fa4911a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,12 +48,12 @@ If($null -ne $SetStatus){
# Start monitoring the Teams logfile when no parameter is used to run the script # Start monitoring the Teams logfile when no parameter is used to run the script
DO { DO {
# Get Teams Logfile and last icon overlay status # 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 -',` 'Setting the taskbar overlay icon -',`
'StatusIndicatorStateService: Added' | Select-Object -Last 1 'StatusIndicatorStateService: Added' | Select-Object -Last 1
# Get Teams Logfile and last app update deamon status # 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',` 'Resuming daemon App updates',`
'Pausing daemon App updates',` 'Pausing daemon App updates',`
'SfB:TeamsNoCall',` 'SfB:TeamsNoCall',`
@ -178,4 +178,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" Invoke-RestMethod -Uri "$HAUrl/api/states/$entityActivity" -Method POST -Headers $headers -Body ([System.Text.Encoding]::UTF8.GetBytes($params)) -ContentType "application/json"
} }
Start-Sleep 1 Start-Sleep 1
} Until ($Enable -eq 0) } Until ($Enable -eq 0)

Loading…
Cancel
Save