Skip to content

Commit 43ee288

Browse files
committed
Fix decoding JSON when running in nanoserver
1 parent 155ade7 commit 43ee288

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

PhpManager/private/Get-PhpManagerConfigurationKey.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Function Get-PhpManagerConfigurationKey
3131
If ($folder) {
3232
$path = Join-Path -Path $folder -ChildPath 'phpmanager.json'
3333
If (Test-Path -PathType Leaf -LiteralPath $path) {
34-
$content = @(Get-Content -LiteralPath $path) -join ''
34+
$content = @(Get-Content -LiteralPath $path) -join "`n"
3535
$json = ConvertFrom-Json -InputObject $content
3636
If ($json.PSobject.Properties.name -eq $Key) {
3737
$result = $json.$Key

PhpManager/private/Set-PhpManagerConfigurationKey.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Function Set-PhpManagerConfigurationKey
3939
$path = Join-Path -Path $folder -ChildPath 'phpmanager.json'
4040
$json = $null
4141
If (Test-Path -PathType Leaf -LiteralPath $path) {
42-
$json = Get-Content -LiteralPath $path | ConvertFrom-Json
42+
$content = @(Get-Content -LiteralPath $path) -join "`n"
43+
$json = ConvertFrom-Json -InputObject $content
4344
}
4445
If (-Not($json)) {
4546
$json = New-Object -TypeName PSCustomObject

0 commit comments

Comments
 (0)