You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with Out-DataTable and AD and when I attempt to pass AD User objects through Out-DataTable it sets the column type of AccountExpirationDate to String because the value is null on the first record.
The text was updated successfully, but these errors were encountered:
Haha, good catch, looks like I added a note when tweaking the original from Chad!
How would you expect this to work? I suppose we could use something that looks at all property types for all objects, and if it sees things like null and string, it picks string (same for other types)?
I'd be up for a PR - if it could be done without too much of a mess, could have it behave as is by default, add a ScanAllPropertyValues or some similar switch that implements the more thorough, but slower code
Yeah, I've been thinking about the best way to solve it because it messes things up when I use it in conjunction with Invoke-SQLiteBulkCopy. For some reason I don't get an error on insert but I do on select when my select includes a column where a bad/conflicting typing has been created due to this bug.
Edit:
The other benefit of doing a more complete check of datatypes/checking more or all rows is to have an early flag on any objects which have inconsistent datatypes on the same property.
I'm working with
Out-DataTable
and AD and when I attempt to pass AD User objects throughOut-DataTable
it sets the column type of AccountExpirationDate to String because the value is null on the first record.The text was updated successfully, but these errors were encountered: