Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
support services with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jabbera committed Aug 18, 2016
1 parent 4923583 commit 0be355e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ $env:CURRENT_TASK_ROOTDIR = Split-Path -Parent $MyInvocation.MyCommand.Path

. $env:CURRENT_TASK_ROOTDIR\Utility.ps1

$serviceNames = $serviceNames -replace '\s','' # no spaces allows in argument lists
$serviceNames = '"' + $serviceNames + '"'

Remote-ServiceStartStop -serviceNames $serviceNames -environmentName $environmentName -adminUserName $adminUserName -adminPassword $adminPassword -startupType $startupType -protocol $protocol -testCertificate $testCertificate -waitTimeoutInSeconds $waitTimeoutInSeconds -internStringFileName "StartWindowsServiceIntern.ps1" -killIfTimedOut "false"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param(
[string][Parameter(Mandatory=$true)] $killIfTimedOut
)

[string[]] $servicesNamesArray = ($serviceNames -split ',').Trim()
[string[]] $servicesNamesArray = ($serviceNames -split ',' -replace '"').Trim()
$presentServicesArray = Get-Service | Where-Object { $servicesNamesArray -contains $_.Name }

if ($servicesNamesArray.Length -ne $presentServicesArray.Length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ $env:CURRENT_TASK_ROOTDIR = Split-Path -Parent $MyInvocation.MyCommand.Path

. $env:CURRENT_TASK_ROOTDIR\Utility.ps1

$serviceNames = $serviceNames -replace '\s','' # no spaces allows in argument lists
$serviceNames = '"' + $serviceNames + '"'

Remote-ServiceStartStop -serviceNames $serviceNames -environmentName $environmentName -adminUserName $adminUserName -adminPassword $adminPassword -startupType $startupType -protocol $protocol -testCertificate $testCertificate -waitTimeoutInSeconds $waitTimeoutInSeconds -internStringFileName "StopWindowsServiceIntern.ps1" -killIfTimedOut $killIfTimedOut
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param(
[string][Parameter(Mandatory=$true)] $killIfTimedOut
)

[string[]] $servicesNamesArray = ($serviceNames -split ',').Trim()
[string[]] $servicesNamesArray = ($serviceNames -split ',' -replace '"').Trim()
$presentServicesArray = Get-Service | Where-Object { $servicesNamesArray -contains $_.Name }

if ($servicesNamesArray.Length -ne $presentServicesArray.Length)
Expand Down

0 comments on commit 0be355e

Please sign in to comment.