Configuration for Windows Servicesedit

Configuration for Windows services can be provided by setting environment variables for the specific Windows service in the Windows registry. With PowerShell

$environment = [string[]]@(

Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\<service-name> -Name Environment -Value $environment 

define the environment variables to use for the Windows service

<service-name> is the name of the Windows service.

The service must then be restarted for the change to take effect

Restart-Service <service-name>