EBOOZ / TeamsStatus

Monitoring your Microsoft Teams status with PowerShell
202 stars 40 forks source link

Service not starting #16

Closed metbril closed 3 years ago

metbril commented 3 years ago

At first the new script including separate settings didn't work. I tried to run it from the command line and that worked. Then I knew it had to be in installing it as a service.

I have been fiddling to get it working. I'm not sure what finally worked, but I think the install script needs modification. The Settings file also needs to be unblocked, I guess?

This was my install script.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Unblock-File .\Settings.ps1
Unblock-File .\Get-TeamsStatus.ps1
Start-Process -FilePath .\nssm.exe -ArgumentList 'install "Microsoft Teams Status Monitor" "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-command "& { . C:\Scripts\Get-TeamsStatus.ps1 }"" ' -NoNewWindow -Wait
Start-Service -Name "Microsoft Teams Status Monitor"
EBOOZ commented 3 years ago

I've updated the readme to unblock Settings.ps1 as well in https://github.com/EBOOZ/TeamsStatus/commit/bbcda22f7711fb8a8a49367b34dc47bb15a1c2c6