### Manage Chocolatey Windows Services Source: https://docs.chocolatey.org/en-us/licensed-extension/release-notes Demonstrates how to install, start, stop, and uninstall a Windows service using Chocolatey's service management functions. Ensure the service name and executable path are correctly specified. ```powershell $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $serviceExe = Join-Path $toolsDir 'service\chocolatey-agent.exe' $packageArgs = @{ Name = 'chocolatey-agent' DisplayName = 'Chocolatey Agent' Description = 'Chocolatey Agent is a background service for Chocolatey.' StartupType = 'Automatic' ServiceExecutablePath = $serviceExe } #Username, Password, -DoNotStartService are also considered Install-ChocolateyWindowsService @packageArgs # The other three methods simply take the service name. Start-ChocolateyWindowsService -Name 'chocolatey-agent' Stop-ChocolateyWindowsService -Name 'chocolatey-agent' Uninstall-ChocolateyWindowsService -Name 'chocolatey-agent' ``` -------------------------------- ### Enable Interactive Background Service Source: https://docs.chocolatey.org/en-us/licensed-extension/release-notes Enable the background service to interactively manage installations. This requires the ChocolateyLocalAdmin account and has security implications. ```bash choco feature enable --name=useBackgroundServiceInteractively ```