|
|
@ -176,11 +176,13 @@ Function Nssm-Update-AppParameters
|
|
|
|
Throw "Error updating AppParameters for service ""$name"""
|
|
|
|
Throw "Error updating AppParameters for service ""$name"""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$appParametersHash = ParseAppParameters -appParameters $appParameters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$appParamKeys = @()
|
|
|
|
$appParamKeys = @()
|
|
|
|
$appParamVals = @()
|
|
|
|
$appParamVals = @()
|
|
|
|
$singleLineParams = ""
|
|
|
|
$singleLineParams = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($appParameters)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$appParametersHash = ParseAppParameters -appParameters $appParameters
|
|
|
|
$appParametersHash.GetEnumerator() |
|
|
|
|
$appParametersHash.GetEnumerator() |
|
|
|
|
% {
|
|
|
|
% {
|
|
|
|
$key = $($_.Name)
|
|
|
|
$key = $($_.Name)
|
|
|
@ -196,15 +198,22 @@ Function Nssm-Update-AppParameters
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Set-Attr $result "nssm_app_parameters" $appParameters
|
|
|
|
|
|
|
|
Set-Attr $result "nssm_app_parameters_parsed" $appParametersHash
|
|
|
|
Set-Attr $result "nssm_app_parameters_parsed" $appParametersHash
|
|
|
|
Set-Attr $result "nssm_app_parameters_keys" $appParamKeys
|
|
|
|
Set-Attr $result "nssm_app_parameters_keys" $appParamKeys
|
|
|
|
Set-Attr $result "nssm_app_parameters_vals" $appParamVals
|
|
|
|
Set-Attr $result "nssm_app_parameters_vals" $appParamVals
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set-Attr $result "nssm_app_parameters" $appParameters
|
|
|
|
Set-Attr $result "nssm_single_line_app_parameters" $singleLineParams
|
|
|
|
Set-Attr $result "nssm_single_line_app_parameters" $singleLineParams
|
|
|
|
|
|
|
|
|
|
|
|
if ($results -ne $singleLineParams)
|
|
|
|
if ($results -ne $singleLineParams)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ($appParameters)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$cmd = "nssm set ""$name"" AppParameters $singleLineParams"
|
|
|
|
$cmd = "nssm set ""$name"" AppParameters $singleLineParams"
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$cmd = "nssm set ""$name"" AppParameters '""""'"
|
|
|
|
|
|
|
|
}
|
|
|
|
$results = invoke-expression $cmd
|
|
|
|
$results = invoke-expression $cmd
|
|
|
|
|
|
|
|
|
|
|
|
if ($LastExitCode -ne 0)
|
|
|
|
if ($LastExitCode -ne 0)
|
|
|
|