I need a PowerShell logic based on windows services and Control panel Programs and Feature. Powershell code have to check whether the "SQL Server (XCELERAINST)" service is running. If the service (Service screenshot in the attachment) is running then it have to print like MSSQL installed already. Also PowerShell code have to check "Microsoft SQL Server 2019 (64 bit)" have been installed in the Control panel Programs and Feature (Screenshot in the attachment). If its already there it have to print like MSSQL installed already. If both state are not expected then it should have to print like MSSQL not installed.
Kindly someone help me on this.
I am looking forward to hearing from you.