Skip to content

Commit 08c104b

Browse files
authored
Running nssm with powershell to get proper parameter quoting. (#9871)
1 parent 660f90a commit 08c104b

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/AccountDeleter/Scripts/Functions.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Function Install-NuGetService() {
2121

2222
Write-Host Installing service $ServiceName...
2323

24-
$installService = "nssm install $ServiceName $ScriptToRun"
25-
cmd /C $installService
24+
& .\nssm.exe install $ServiceName $ScriptToRun
2625

2726
Set-Service -Name $ServiceName -DisplayName "$ServiceTitle - $ServiceName" -Description "Runs $ServiceTitle." -StartupType Automatic
2827
sc.exe failure $ServiceName reset= 30 actions= restart/5000

src/GitHubVulnerabilities2Db/Scripts/Functions.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Function Install-NuGetService() {
2121

2222
Write-Host Installing service $ServiceName...
2323

24-
$installService = "nssm install $ServiceName $ScriptToRun"
25-
cmd /C $installService
24+
& .\nssm.exe install $ServiceName $ScriptToRun
2625

2726
Set-Service -Name $ServiceName -DisplayName "$ServiceTitle - $ServiceName" -Description "Runs $ServiceTitle." -StartupType Automatic
2827
sc.exe failure $ServiceName reset= 30 actions= restart/5000

src/GitHubVulnerabilities2v3/Scripts/Functions.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Function Install-NuGetService() {
2121

2222
Write-Host Installing service $ServiceName...
2323

24-
$installService = "nssm install $ServiceName $ScriptToRun"
25-
cmd /C $installService
24+
& .\nssm.exe install $ServiceName $ScriptToRun
2625

2726
Set-Service -Name $ServiceName -DisplayName "$ServiceTitle - $ServiceName" -Description "Runs $ServiceTitle." -StartupType Automatic
2827
sc.exe failure $ServiceName reset= 30 actions= restart/5000

src/VerifyGitHubVulnerabilities/Scripts/Functions.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Function Install-NuGetService() {
2121

2222
Write-Host Installing service $ServiceName...
2323

24-
$installService = "nssm install $ServiceName $ScriptToRun"
25-
cmd /C $installService
24+
& .\nssm.exe install $ServiceName $ScriptToRun
2625

2726
Set-Service -Name $ServiceName -DisplayName "$ServiceTitle - $ServiceName" -Description "Runs $ServiceTitle." -StartupType Automatic
2827
sc.exe failure $ServiceName reset= 30 actions= restart/5000

0 commit comments

Comments
 (0)