For my hobby project ConvertTo-Expression, I would like the output expression of my cmdlet (by default) compliant with the Constrained Language mode. For this, I might include a hardcoded list with Allowed Types:
$AllowedTypes = # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7
[Array],
[Bool],
[byte],
[char],
[DateTime],
[decimal],
...
but I rather automatically retrieve the list of Allowed Types from PowerShell itself, knowing that would be most up-to-date version (e.g. the [Ordered] type isn't listed on the website but does appear to be allowed in Constrained Language mode).
Is there a way to do this?
Or:
How can I check (in full language mode) if a specific type is compliant with constrained language mode?