3 ms·
ls and grep are aliases in powershell, so not exactly the same, but pretty close For your first question: you have converted types. When you did a ConvertTo-Js
by new_hackers 10y ago
ls and grep are aliases in powershell, so not exactly the same, but pretty close
For your first question: you have converted types.
When you did a ConvertTo-Json, you serialized the System.IO.DirectoryInfo type into JSON compatible data. When you ConvertFrom-Json you have a PCSCustomObject.
The conversion to CSV is different for the System.IO.DirectoryInfo than the PSCustomObject.
This has to do with the sub-types (converting from objects into serializable JSON objects). It also appears to handle time strings differently as well.