invoke-webrequest to start the download
convertfrom-json to parse
export-csv to create the csv
Download JSON file and export it to csv
Burim Rama
21
Reputation points
Hi
I need to download af JSON file through API and convert it to csv as i need to update some attributes in AD server, this need to download the file as schedule job every night.
Any idea ?
Windows for business Windows Server User experience PowerShell
8,330 questions
2 answers
Sort by: Most helpful
-
vTech 6 Reputation points
2021-02-07T21:37:50.197+00:00 -
Anonymous
2021-02-08T05:21:32.123+00:00 Hi,
Here is an example
$uri = 'https://.../data.json' $file = 'D:\data.csv' (Invoke-WebRequest -Uri $uri | ConvertFrom-Json)| Export-csv -Path $file -NoTypeInformation
Best Regards,
Ian Xue============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.