Windows service can be managed using few PowerShell cmdlets.
Install Windows service into operating system:
New-Service -BinaryPathName .\PathTo\MyWinService.exe -Name MyWinService ` -DisplayName "My Windows Service" -StartupType Automatic
List installed Windows services using wildcard:
Get-Service *my*
Get Windows service by name:
Get-Service MyWinService
Start Windows service:
Start-Service MyWinService
or:
Get-Service MyWinService | Start-Service
Run Service Management Console to check in UI whether Windows service is installed and running:
services.msc
Stop Windows service:
Stop-Service MyWinService
or:
Get-Service MyWinService | Stop-Service
Uninstall Windows service from operating system in PowerShell 5.0 or previous:
(Get-WmiObject -Class Win32_Service -Filter "Name='MyWinService'").Delete()
Uninstall Windows service from operating system in PowerShell 6.0 or later:
Remove-Service MyWinService
If you are interested in Windows services and how to migrate them to Azure, take my Udemy course Migrate Windows service to Azure.