Fix Windows agent SC CREATE binPath quoting
The binPath parameter value needs outer quotes when it contains embedded quotes and spaces. Without this, SC.EXE parses the value incorrectly and fails to create the service. Related to #776
This commit is contained in:
parent
806cdd2d87
commit
5a43ab4e57
1 changed files with 1 additions and 1 deletions
|
|
@ -315,7 +315,7 @@ if (-not [string]::IsNullOrWhiteSpace($AgentId)) { $ServiceArgs += @("--agent-id
|
|||
$BinPath = "`"$DestPath`" $($ServiceArgs -join ' ')"
|
||||
|
||||
# Create Service with error handling
|
||||
$scOutput = sc.exe create $AgentName binPath= $BinPath start= auto displayname= "Pulse Unified Agent" 2>&1
|
||||
$scOutput = sc.exe create $AgentName binPath= "$BinPath" start= auto displayname= "Pulse Unified Agent" 2>&1
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Show-Error "Failed to create service '$AgentName'.`nsc.exe output: $scOutput"
|
||||
Exit 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue