Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduce deep copy fix #264

Open
wants to merge 5 commits into
base: v2
Choose a base branch
from

Conversation

joseartrivera
Copy link
Contributor

@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