I would like to work using powershell and json files.
I have a JSON file generated from an Invoke-RestMethod on Powershell.
The output json file look like :
[
{
"_id": "ID1",
"isTemplate": true,
"origin": "SPO_Promoteur_DEV",
"tenant": "spo",
"reference": "HbiuOzq1u",
"date": "2019-02-04T16:01:35.230Z",
"data":
{
"tasks":
{
"rows": [
{
"parentId": "root",
"entities": [
"Something there"
],
"Name": "A name there"
},
{
"parentId": "Z9zgsHzFad",
"entities": [
"urn:CodeEtape:DONGEN:CodeAction:TEST1"
],
"Duration": 0,
"index": 0,
"Id": "wWotapvig"
}
]
}
}
},
{
"_id": "ID12",
"isTemplate": true,
"origin": "SPO_Promoteur_DEV",
"tenant": "spo",
"reference": "Hbkjh548u",
"date": "2019-02-04T16:01:35.230Z",
"data":
{
"tasks":
{
"rows": [
{
"parentId": "root",
"entities": [
"Something else there"
],
"Name": "An other name there"
},
{
"parentId": "Z9zgszffzfHzFad",
"entities": [
"urn:CodeEtape:DONGEN:CodeAction:TEST1"
],
"Duration": 0,
"index": 0,
"Id": "wWotapvig"
}
]
}
}
}
]
I would like to separate this json file.
How can i generate json files named reference.json (where reference is given on the json main file) AND having isTemplate as true ?
So i'll get X file, each of them having their reference as name, and each of them having the IsTemplate parameter to TRUE.
Thanks for helping
Convertfrom-json?$LoginResponse | ConvertTo-Json -Depth 10 | Out-File -FilePath .\Process.jsonI Used this command just after theInvoke-RestMethodone. I don't see the goal on converting to JSON and converting from JSON just after it ? @RanadipDutta