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

Commit

Permalink
added deserialze fix to Get-DSCPullServerESERecord (#55) (#57)
Browse files Browse the repository at this point in the history
!Deploy

* added deserialze fix to Get-DSCPullServerESERecord
* fix #56. Pull server was unable to cast string[] to generic list[string]
* updated manifest
  • Loading branch information
bgelens authored Apr 30, 2019
1 parent 4ea78bc commit 1a3904c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions DSCPullServerAdmin/DSCPullServerAdmin.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions DSCPullServerAdmin/private/Get-DSCPullServerESERecord.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion DSCPullServerAdmin/private/Set-DSCPullServerESERecord.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1a3904c

Please sign in to comment.