Skip to content

Commit

Permalink
Merge pull request #8242 from spacecowboy/3.0-powershellcontains
Browse files Browse the repository at this point in the history
Fixed `neo4j install-service` on Windows 7
  • Loading branch information
benbc committed Nov 1, 2016
2 parents d96ba3b + e3ec926 commit 89e608f
Showing 1 changed file with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,26 @@ Function Merge-Neo4jJavaSettings

$Additional | ForEach-Object -Process {
$thisSetting = $_
If (-not $Source.contains($thisSetting)) {
if ($matches -ne $null) { $matches.Clear() }
if ($thisSetting -match $SettingNameRegEx) {
$thisSettingName = $matches[1]
if ($matches -ne $null) { $matches.Clear() }
if ($thisSetting -match $SettingNameRegEx) {
$thisSettingName = $matches[1]

$oldValue = $null
$SettingOutput.GetEnumerator() | ForEach-Object -Process {
if ($_.Value -eq $thisSettingName) { $oldValue = $_.Key}
}
$oldValue = $null
$SettingOutput.GetEnumerator() | ForEach-Object -Process {
if ($_.Value -eq $thisSettingName) { $oldValue = $_.Key}
}

if ($oldValue -eq $null) {
Write-Verbose "Adding '$thisSetting'"
$SettingOutput.Add($thisSetting,'')
} else {
Write-Verbose "Merging '$thisSetting'"
$SettingOutput.Remove($oldValue)
$SettingOutput.Add($thisSetting,$thisSettingName)
}
} else {
if ($oldValue -eq $null) {
Write-Verbose "Adding '$thisSetting'"
$SettingOutput.Add($thisSetting,'')
} else {
Write-Verbose "Merging '$thisSetting'"
$SettingOutput.Remove($oldValue)
$SettingOutput.Add($thisSetting,$thisSettingName)
}

} else {
Write-Verbose "Ignoring '$thisSetting' as it is already defined"
Write-Verbose "Adding '$thisSetting'"
$SettingOutput.Add($thisSetting,'')
}
}

Expand Down

0 comments on commit 89e608f

Please sign in to comment.