Skip to content

Conversation

@joseartrivera
Copy link
Collaborator

@joseartrivera joseartrivera commented Jun 13, 2024

In #260 we used DeepCopy-Object to create a copy of hashtables and pscustomobjects. This caused enums to be treated as PSCustomObjects and would later throw exceptions when Convert-EnumToString would call the copy() function on it.

My initial thought to fix was to call Convert-EnumToString before doing the deep-copy. However I noticed Convert-EnumToString is accomplishing the same thing we want to do and instead of using DeepCopy it does a shallow copy with Copy() and Clone() and then recursively makes more shallow copies.

We can modify our original solution to do the same thing since we are also calling child objects recursively if we plan on modifying them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants