KO
|
EN
gitlite — search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#claude-code
#codex
#cli
#developer-tools
#react
#windows
Cake.Services
★ 25
Open GitHub ↗
Windows Services addin for Cake
Download README (.md)
Explore Similar Repositories
Cake.WebDeploy
:
WebDeploy addin for Cake
Cake.Docker
:
Cake AddIn that extends Cake with Docker
Cake.Unity
:
Unity build support for Cake.
Cake.Sonar
:
:cake: :jigsaw: Cake addin to execute the MSBuild scanner for SonarQube in Cake builds
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
Cake.Services
?
Download (.md)
# Cake.Services Cake-Build addin that extends Cake with windows service commands [](https://ci.appveyor.com/project/SharpeRAD/cake-services) [](http://cakebuild.net/) [](https://gitter.im/cake-build/cake) ## Table of contents 1. [Implemented functionality](https://github.com/SharpeRAD/Cake.Services#implemented-functionality) 2. [Referencing](https://github.com/SharpeRAD/Cake.Services#referencing) 3. [Usage](https://github.com/SharpeRAD/Cake.Services#usage) 4. [Example](https://github.com/SharpeRAD/Cake.Services#example) 5. [Plays well with](https://github.com/SharpeRAD/Cake.Services#plays-well-with) 6. [License](https://github.com/SharpeRAD/Cake.Services#license) 7. [Share the love](https://github.com/SharpeRAD/Cake.Services#share-the-love) ## Implemented functionality * Start * Stop * Restart * Pause * Continue * Execute Command * Get Service * Get Status * Install * Uninstall * Manage remote services ## Referencing [](https://www.nuget.org/packages/Cake.Services/) [](https://www.nuget.org/packages/Cake.Services/) Cake.Services is available as a nuget package from the package manager console: ```csharp Install-Package Cake.Services ``` or directly in your build script via a cake addin directive: ```csharp #addin "Cake.Services" ``` ## Usage ```csharp #addin "Cake.Services" Task("Start-Service") .Description("Start a stopped windows service") .Does(() => { StartService("MpsSvc"); }); Task("Stop-Service") .Description("Stop a running windows service") .Does(() => { StopService("MpsSvc", "remote-location"); }); Task("Restart-Service") .Description("Restart a running windows service") .Does(() => { RestartService("MpsSvc"); }); Task("Pause-Service") .Description("Pause a running windows service") .Does(() => { PauseService("MpsSvc"); }); Task("Continue-Service") .Description("Continue a paused windows service") .Does(() => { ContinueService("MpsSvc", "remote-location"); }); Task("Execute-Command") .Description("Execute a command on a running service") .Does(() => { ExecuteServiceCommand("MyService", 4); }); Task("Get-Service") .Description("Get a windows service object installed on a machine") .Does(() => { ServiceController controller = GetService("MpsSvc", "remote-location"); if (controller != null) { controller.Stop(); } }); Task("Is-Service-Running") .Description("Check if a windows service is running") .Does(() => { bool status = IsServiceRunning("MpsSvc"); if (status) { Debug("YAY!"); } }); Task("Is-Service-Stopped") .Description("Check if a windows service is stopped") .Does(() => { bool status = IsServiceStopped("MpsSvc"); if (status) { Debug("YAY!"); } }); Task("Install-Service") .Description("Install a windows service") .Does(() => { InstallService("remote-location", new InstallSettings() { ServiceName = "Popup", DisplayName = "Annoying popup", Description = "Displays adds every time you move the mouse", ExecutablePath = "C:/LOL/Popup.exe", StartMode = "auto", Username = "Admin", Password = "pass1" }); }); Task("Uninstall-Service") .Description("Uninstall a windows service") .Does(() => { UninstallService("Popup", "remote-location"); }); RunTarget("Start-Service"); ``` ## Example A complete Cake example can be found [here](https://github.com/SharpeRAD/Cake.Services/blob/master/test/build.cake). ## TroubleShooting * Please be aware of the breaking changes that occurred with the release of [Cake v0.22.0](https://cakebuild.net/blog/2017/09/cake-v0.22.0-released), you will need to upgrade Cake in order to use Cake.Services v0.3.0 or above. ## Plays well with If your looking to manage Topshelf windows services its worth checking out [Cake.Topshelf](https://github.com/SharpeRAD/Cake.Topshelf). If your looking for a way to trigger cake tasks based on windows events or at scheduled intervals then check out [CakeBoss](https://github.com/SharpeRAD/CakeBoss). ## License Copyright (c) 2015 - 2016 Phillip Sharpe Cake.Services is provided as-is under the MIT license. For more information see [LICENSE](https://github.com/SharpeRAD/Cake.Services/blob/master/LICENSE). ## Share the love If this project helps you in anyway then please :star: the repository.