diff --git a/DSCPullServerAdmin/DSCPullServerAdmin.psd1 b/DSCPullServerAdmin/DSCPullServerAdmin.psd1 index 6efe783..b5ebc95 100644 --- a/DSCPullServerAdmin/DSCPullServerAdmin.psd1 +++ b/DSCPullServerAdmin/DSCPullServerAdmin.psd1 @@ -27,10 +27,10 @@ Author = 'Ben Gelens' # CompanyName = 'Unknown' # Copyright statement for this module -Copyright = '(c) 2018 Ben Gelens. All rights reserved.' +Copyright = '(c) 2019 Ben Gelens. All rights reserved.' # Description of the functionality provided by this module -Description = 'Get, manipulate and migrate data from your DSC Pull Server database (EDB and SQL)' +Description = 'Get, manipulate and migrate data from your DSC Pull Server database (MDB, EDB and SQL)' # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '5.1' @@ -128,8 +128,8 @@ PrivateData = @{ # ReleaseNotes of this module ReleaseNotes = 'EDB Fixes: -* StatusReport move from Last to Previous. Issue: #43. -* Registration and devices from from First to Next. Issue: #51' +* Fixed deserialization issue for StatusData Issue: #54. +* Fixed typecasting issue for ConfigurationNames / StatusData and Errors resulting in Pull Server errors. Issue: #56' } # End of PSData hashtable diff --git a/DSCPullServerAdmin/private/Get-DSCPullServerESERecord.ps1 b/DSCPullServerAdmin/private/Get-DSCPullServerESERecord.ps1 index babe16e..f80d27f 100644 --- a/DSCPullServerAdmin/private/Get-DSCPullServerESERecord.ps1 +++ b/DSCPullServerAdmin/private/Get-DSCPullServerESERecord.ps1 @@ -109,7 +109,7 @@ function Get-DSCPullServerESERecord { try { [void][ipaddress]::Parse($_) $_ - } catch {} + } catch { } } } elseif ($column.Name -in $boolColumns) { $result."$($column.Name)" = [Microsoft.Isam.Esent.Interop.Api]::RetrieveColumnAsBoolean( @@ -136,7 +136,13 @@ function Get-DSCPullServerESERecord { $column.Columnid ) if ($column.Name -eq 'StatusData') { - $result."$($column.Name)" = $data | ConvertFrom-Json -ErrorAction SilentlyContinue + if ($null -ne $data) { + if ($data.GetType() -like 'psobject*') { + $result."$($column.Name)" = $data + } else { + $result."$($column.Name)" = $data | ConvertFrom-Json -ErrorAction SilentlyContinue + } + } } else { $result."$($column.Name)" = $data } diff --git a/DSCPullServerAdmin/private/Set-DSCPullServerESERecord.ps1 b/DSCPullServerAdmin/private/Set-DSCPullServerESERecord.ps1 index 06ed673..d041050 100644 --- a/DSCPullServerAdmin/private/Set-DSCPullServerESERecord.ps1 +++ b/DSCPullServerAdmin/private/Set-DSCPullServerESERecord.ps1 @@ -39,7 +39,7 @@ function Set-DSCPullServerESERecord { $Connection.SessionId, $Connection.TableId, $columnDictionary[$_], - $InputObject.$_ + [Collections.Generic.List[String]]$InputObject.$_ ) } elseif ($_ -eq 'IPAddress') { [Microsoft.Isam.Esent.Interop.Api]::SetColumn(