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

ConvertTo-FlatObject, DataType to String #35

Open
DonDom86 opened this issue Mar 20, 2023 · 3 comments
Open

ConvertTo-FlatObject, DataType to String #35

DonDom86 opened this issue Mar 20, 2023 · 3 comments

Comments

@DonDom86
Copy link

Why do you convert the datatypes all to string?
Is it needed?

... Line 99
elseif ($Object.GetType().Name -in 'String', 'DateTime', 'TimeSpan', 'Version', 'Enum') {
$Object = $Object.ToString()
} elseif ($Depth)
...

Best Regards

@PrzemyslawKlys
Copy link
Member

Why not? It's for display purposes. If you don't convert Enum to string you will end up with numbers in your exports to HTML for example.

@DonDom86
Copy link
Author

I wanted to use the function for a different use case. Here I need the original data types ...
Do you want to implement my enhancement?
I think there is no problem with 'DateTime', 'TimeSpan'.

Best regards

@PrzemyslawKlys
Copy link
Member

You could implement a switch to not do conversion. Feel free

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

No branches or pull requests

2 participants