-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace environment variable with specific path #34
base: main
Are you sure you want to change the base?
Conversation
The service runs as LocalService so the $env:APPDATA path is incorrect.
@@ -66,7 +66,7 @@ $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 -eq $null){ } | |||
If ($null -eq $TeamsStatus) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's best practice in PowerShell to have the $null
on the left of checks - See here
This PR basically reverts #28? |
This needs to be merged, otherwise the service does not work. I didn't find any other way around, as nssm does not allow to set the user to start the service without asking for its password. |
Instead of hardcoding the path, would it be an option to test if the |
It should be. I suppose the most difficult part is to actually test what's inside $env:APPDATA when running as a service. |
Google lead me here: One could test against this result. But i don't mind a hardcoded path. |
This is what i've come up with.
Then use
|
The service runs as LocalService so the $env:APPDATA path is incorrect.
Resolves #33