Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 1a3904c

Browse files
authored
added deserialze fix to Get-DSCPullServerESERecord (#55) (#57)
!Deploy * added deserialze fix to Get-DSCPullServerESERecord * fix #56. Pull server was unable to cast string[] to generic list[string] * updated manifest
1 parent 4ea78bc commit 1a3904c

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

DSCPullServerAdmin/DSCPullServerAdmin.psd1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Author = 'Ben Gelens'
2727
# CompanyName = 'Unknown'
2828

2929
# Copyright statement for this module
30-
Copyright = '(c) 2018 Ben Gelens. All rights reserved.'
30+
Copyright = '(c) 2019 Ben Gelens. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
33-
Description = 'Get, manipulate and migrate data from your DSC Pull Server database (EDB and SQL)'
33+
Description = 'Get, manipulate and migrate data from your DSC Pull Server database (MDB, EDB and SQL)'
3434

3535
# Minimum version of the Windows PowerShell engine required by this module
3636
PowerShellVersion = '5.1'
@@ -128,8 +128,8 @@ PrivateData = @{
128128
# ReleaseNotes of this module
129129
ReleaseNotes = 'EDB Fixes:
130130
131-
* StatusReport move from Last to Previous. Issue: #43.
132-
* Registration and devices from from First to Next. Issue: #51'
131+
* Fixed deserialization issue for StatusData Issue: #54.
132+
* Fixed typecasting issue for ConfigurationNames / StatusData and Errors resulting in Pull Server errors. Issue: #56'
133133

134134
} # End of PSData hashtable
135135

DSCPullServerAdmin/private/Get-DSCPullServerESERecord.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function Get-DSCPullServerESERecord {
109109
try {
110110
[void][ipaddress]::Parse($_)
111111
$_
112-
} catch {}
112+
} catch { }
113113
}
114114
} elseif ($column.Name -in $boolColumns) {
115115
$result."$($column.Name)" = [Microsoft.Isam.Esent.Interop.Api]::RetrieveColumnAsBoolean(
@@ -136,7 +136,13 @@ function Get-DSCPullServerESERecord {
136136
$column.Columnid
137137
)
138138
if ($column.Name -eq 'StatusData') {
139-
$result."$($column.Name)" = $data | ConvertFrom-Json -ErrorAction SilentlyContinue
139+
if ($null -ne $data) {
140+
if ($data.GetType() -like 'psobject*') {
141+
$result."$($column.Name)" = $data
142+
} else {
143+
$result."$($column.Name)" = $data | ConvertFrom-Json -ErrorAction SilentlyContinue
144+
}
145+
}
140146
} else {
141147
$result."$($column.Name)" = $data
142148
}

DSCPullServerAdmin/private/Set-DSCPullServerESERecord.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function Set-DSCPullServerESERecord {
3939
$Connection.SessionId,
4040
$Connection.TableId,
4141
$columnDictionary[$_],
42-
$InputObject.$_
42+
[Collections.Generic.List[String]]$InputObject.$_
4343
)
4444
} elseif ($_ -eq 'IPAddress') {
4545
[Microsoft.Isam.Esent.Interop.Api]::SetColumn(

0 commit comments

Comments
 (0)