Installing a Windows Service with Powershell

by ebarcza 3/31/2020 11:27:00 AM

Install your service manually using PowerShell

  1. From the Start menu, select the Windows PowerShell directory, then select Windows PowerShell.

  2. Access the directory where your project's compiled executable file is located.

  3. Run the New-Service cmdlet with the with your project's output and a service name as parameters:

New-Service -Name "YourServiceName" -BinaryPathName <yourproject>.exe

 

Uninstall your service manually using PowerShell

  1. From the Start menu, select the Windows PowerShell directory, then select Windows PowerShell.

  2. Run the Remove-Service cmdlet with the name of your service as parameter:

Remove-Service -Name "YourServiceName"

sc.exe delete "YourServiceName" for PSVersion 5.1

Tags: ,

Powershell

Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.

by ebarcza 6/23/2017 9:58:00 AM
[No text]

Tags:

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  October 2020  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2020

Sign in