
We get what we expect in our CSV file without the additional work scripted into the first hash table to CSV article from 2018. This converts each entry in our hash table into an object, and sends the object to the Export-Csv cmdlet. Once that’s populated, instead of using the hash table’s GetEnumerator method, we’ll use. We’ll start with our previously used hash table. While I won’t show the previous option, revisit the first article on this topic to see the old way here’s the new way. It does work, with less work, so let’s try it on. I’ve long used this to create custom objects for its speed and insertion order preservation (over New-Object), but it didn’t occur to make use of it when getting a hash table into a CSV. We can use, introduced in (Windows) PowerShell 3.0. Well, my option wasn’t the only option, and so today I’ll pass along something someone on Twitter pointed out that I hadn’t considered myself. Maybe it was for configuration I still don’t recall. I was sitting around and wondered how to best get a hash table into a CSV file. It’s always been a popular post, but just in case you didn’t follow this over from, then you need to know this is a forward movement on that 2018 article. Bear in mind that i'm a rookie when it comes to powershell. As proven, those are sometimes the most popular posts.īefore we get back into this, let’s remember how this all started. Convert json to csv I've googled this to death, and tried numerous different solutions, and i cant get it working. I put a link to the original post on Twitter recently, and someone provided me an idea for an update - whether they realized it or not.

That’s what we’re doing today with this post. I’ve been looking for a way to take its personal success and provide more to the reader about the topic. There’s a particular post on my site that sees the largest amount of consistent visitors: It’s Hash Table to CSV.

What I’m really out to say here, is that in my time, I’ve noticed which of my writings have been consistently popular.
