PrtgAPI icon indicating copy to clipboard operation
PrtgAPI copied to clipboard

Get-ObjectProperty : Could not deserialize value 'DiscardResult'

Open carsten0407 opened this issue 1 year ago • 2 comments

Describe the bug

With a few sensors, I get the following error message when querying the properties: I see the same bug in #214 but ist must be a differnet error, it was in 2021

Steps to reproduce

get-sensor -id 26740 | Get-ObjectProperty

What is the output of 'Get-PrtgClient -Diagnostic'?

Get-ObjectProperty : Could not deserialize value 'DiscardResult' as it is not a valid member of type 'PrtgAPI.DebugMode'. Could not process XML '<injected_writeresult>DiscardResult</injected_writeresult>'.
At line:1 char:24
+ get-sensor -id 26740 | Get-ObjectProperty
+                        ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ObjectProperty], XmlDeserializationException
    + FullyQualifiedErrorId : PrtgAPI.XmlDeserializationException,PrtgAPI.PowerShell.Cmdlets.GetObjectProperty

Additional context

PSVersion : 5.1.14393.6343 PSEdition : Desktop OS : Microsoft Windows Server 2016 Datacenter PrtgAPIVersion : Unknown Culture : en-US CLRVersion : .NET Framework 4.8 (528049) PrtgVersion : 24.2.94.1400 PrtgLanguage : english.lng

ModuleType Version Name ExportedCommands


Binary 0.9.19 PrtgAPI {Add-Device, Add-Group, Add-NotificationTrigger, Add-Sensor...}

carsten0407 avatar May 22 '24 12:05 carsten0407

You can work around this for now by doing Get-ObjectProperty -Raw

lordmilko avatar May 23 '24 13:05 lordmilko

it works, thanxs

carsten0407 avatar May 24 '24 06:05 carsten0407