Update PSService.ps1
Update PSService.ps1

Updated the C# OnStop() procedure adding the sections
                       try{
                       }catch{
                       }finally{
                       }
This resolved the issue where stopping the service would leave the PowerShell process -Service still running. This unclosed process was an orphaned process that remained until the pid was manually killed or the computer was rebooted.
JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib,JFLarvoire/SysToolsLib