Unable to remove card element, help file a little fuzzy

I am trying a number of things to get around the issue in this thread: Move an element from one card to another - PowerShell Universal - Ironman Software Forums and think I have found an issue.

The help file has an example of removing and adding an element, and I thought that might work: remove the card from the one parent and add it to the other. The help file says nothing about this only working on certain elements, but it does not seem to work on a card. First, the help file uses the action Remove-UDComponent, but I get an error that no such action exists. I do see Remove-UDElement, so I am guessing that is the correct action. If that is not correct, that may be some of my problem.

This works just fine:

    New-UDTypography -Id "MyText" -Text "Test Me"

    New-UDButton -Text "Press Me" -OnClick {
        Remove-UDElement -Id "MyText"
    }

If I do something like this, however, I can only remove the child component, not the card itself.

    New-UDCard -Id "MyCard" -Content {
        New-UDTypography -Id "MyText" -Text "Test Me"
    }

    New-UDButton -Text "Press Me" -OnClick {
        Remove-UDElement -Id "MyText"
    }

I also tried the Clear-UDElement from the help file, but that does not work for me either. Is there a way to delete the parent element, regardless of children? Or, a way to at least cycle through all children, when I won’t necessarily be able to hard-code their IDs, and delete them, then delete the parent?

Product: PowerShell Universal
Version: 3.10.5

@Support Should the Remove-UDElement only remove certain elements? If that is the case, I can put something in to request the help file be updated.

Why not just create a parent element like this:

New-UDElement -Tag div -id "parentElementName" -Content {
    your card and other stuff here.
}

Then use Remove-UDElement against that, or just set the contents to empty?

Thanks for the response, I guess that is the clarity I was after (probably did not word it well). It seems like a requirement to have it in a parent like this if I want to reload or remove; I cannot just create the card/typography/etc. on its own.

Essentially yeah, there always needs to be a static element available for those functions to interact with!