'Creating a background service in .net 5 without running powershell

I am creating a simple background service in .NET5 like the one in this Microsoft tutorial https://docs.microsoft.com/en-us/dotnet/core/extensions/windows-service.

After publishing the document says you need to run the following Powershell command:

sc.exe create ".NET Joke Service" binpath="C:\Path\To\App.WindowsService.exe"

How can I go about doing this without running the Powershell command? The service is being handed off to another user that cannot run Powershell.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source