DVLS Module: Maybe a Bug in Convert-XMLToPSCustomObject

DVLS Module: Maybe a Bug in Convert-XMLToPSCustomObject

avatar

Hi All

Im trying to check an Entry Permission via Get-DSEntry -EntryId $entryID -AsRDMConnection which works so far.
$entry.Body.data.ConnectionInfo returns me the complete XML Information which i need:

<Security>
	<Permissions>
		<ConnectionPermission>
			<Override>Custom</Override>
			<Right>Edit</Right>
			<RoleValues>06cc4d33-be0c-4f92-9c16-a0f5defc1bbe, 8458f56d-9b29-4b10-9c25-1784ece387be, 93382b89-b319-4171-9493-46930d4ed46d, e43528d2-1fad-46bb-a323-22d233489868</RoleValues>
		</ConnectionPermission>
		<ConnectionPermission>
			<Override>Custom</Override>
			<Right>Delete</Right>
			<RoleValues>93382b89-b319-4171-9493-46930d4ed46d, e43528d2-1fad-46bb-a323-22d233489868</RoleValues>
		</ConnectionPermission>
		<ConnectionPermission>
			<Override>Custom</Override>
			<Right>Move</Right>
			<RoleValues>93382b89-b319-4171-9493-46930d4ed46d, e43528d2-1fad-46bb-a323-22d233489868</RoleValues>
		</ConnectionPermission>
	</Permissions>
	<RoleOverride>Custom</RoleOverride>
</Security>


But when im using Convert-XMLToPSCustomObject it doesnt displays me the specific Permissions:
forum image

For me it looks like there is a missing Default statement in the Function:
forum image

The ConnectionPermission Property is a System.Object[] - that why it will not shown up:
forum image

Working Fixes for me:
Adding on Line 14 another Match for System.Objects:

($_.Definition -Match '^\System.Xml.XmlElement\b.*$' -or $_.Definition -Match '^\System.Object\b.*$')


Or Adding a Default Statement instead of Expressions (replacing Line 14 with }else{)

Best Regards,
Andreas

All Comments (4)

avatar

Hello Andreas,

It does appear to be a bug; I have asked the engineer team to take a look at the issue.

I will keep you posted when I receive updates.

Best regards,

Richard Boisvert

avatar

Hi,

We have recently merged the DVLS module in the Devolutions.PowerShell module.
That issue should be fixed in that version.
Let me know if this is the case.

Regards

Jonathan Lafontaine

avatar

Hi Jonathan

I dont work with the Devolutions.PowerShell module from PSGallery, im using the Git Release.
Looks like there is still the unfixed Function available.

What are the differences between Git and PSGallery Releases? Are there any missing Functions on PSG? Should i switch to PSGallery?

Best Regards,
Andreas

avatar

Hi Andreas,

The PSG version is the way forward. It mostly is a drop in replacement for the old git module.
Aside a couple missing utility functions (that I'm working on implementing) everything should be there.

Regards.

Jonathan Lafontaine