Format-Table on Array of Hash Tables. Ask Question 30. Convert name and Value to column and rows during Export to CSV in Powershell. Format the output of a hash table in Powershell to output to one line. How to enumerate a Format-Table entry in PowerShell?
Convert items in Arrays to Hash Tables
I have a weird script issue that I'm not sure how to solve. I have a script that is running multiple scripts in a modules folder and then reading the output from those scripts. I am trying to send this data into two separate programs, both Prometheus and Splunk. Because both of these programs require a specific format for their inputs, I am having a hard time getting both outputs to display correctly.
I have the Prometheus side of things functioning correctly, but I also need to send this information to Splunk.
I want to select the lines of the output and convert them into a hashtable. I'm trying to push this info into a json file that splunk can read, so I need the output to be in a hashtable so the json converts properly.
I know this is a very specific weird question.
Here is the pastebin link for the portion of the script I'm struggling with:
Any help is appreciated.