HI, I am Bikash, I am a student. As per my regular task , i got some issue that, unable to convert the csv file to json format.
Script -
import-csv "C:\Users\Desktop\ps\VM details" | ConvertTo-Json | Add-Content -Path "C:\Users\Desktop\ps\[login to view URL]"
While run this script , out put is not correct as am getting null values.
Could you please help me on this ?
================Expectation output should like below ===============
[
{
"VM Name": "bratsc01",
"Disk Path": "/", "/common", "/common/vdisk_mnt",
"NIC card": "2",
"Disk Capacity": "5.62","43.81", "15.62"
},
{
"VM Name": "bratsc02a",
"Disk Path": "/", "/boot", "/tmp", "/config_bak", "/config", "/var/dump", "/var/log",
"NIC card": "2",
"Disk Capacity": "10.19", "0.92", "10.19", "3.69", "28.94", "28.94", "9.25"
}
]
======================================================
Your output is not a valid JSON. It should be (same for "Disk Capacity"):
"Disk Path": ["/", "/common", "/common/vdisk_mnt"],
I can provide you a working script that will output a correct JSON file for just 4000 INR total.
Roman
Hello,
I'm HieuHoang, a System Admin.
I have 3-years of experience working with Powershell script relate Windows, Active directory, Office 365...
I think I can help you complete it soon.
Please consider and contact me, we will discuss all the requirements needed to complete it.
Thank you.
Hi i have 15 years experience in SQL Server Database Development, MYSQL and Postgress , Powershell, Power BI, C# and Python. I will be able to help you with the project. Please ping me offline to discuss further.
Hello Sir, I have created many powershell scripts. I have understood your requirements you want to convert csv file to json file. Lets start the discussion.