Bonjour à tous, je souhaite rechercher via powershell si un objet json est présent dans un fichier, actuellement je tente via cette syntaxe qui me retourne toujours un resultat vide mais sans aucun message d'erreur. Auriez-vous une idée du soucis ?

Render.json
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
[
    "{\n\"id\": \"STRAG15022020\",\n\"name\":\"STRAG\",\n\"date\":15022020,\n\"url\":[\"\\hosts\\STRAG\\security\\15022020security.json\",\n\"\\hosts\\STRAG\\application\\15022020application.json\", \n\"\\hosts\\STRAG\\system\\15022020system.json\"]\n}"
,
    "{\n\"id\": \"STRAG15022020\",\n\"name\":\"STRAG\",\n\"date\":15022020,\n\"url\":[\"\\hosts\\STRAG\\security\\15022020security.json\",\n\"\\hosts\\STRAG\\application\\15022020application.json\", \n\"\\hosts\\STRAG\\system\\15022020system.json\"]\n}"
]
Code powershell : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
$PathRender = "C:\datas\render.json"
$Allcontent = (Get-Content -Path "$PathRender") -join "`n"
$TuplesContent = ConvertFrom-Json –InputObject $Allcontent
$MatchTuple = $TuplesContent | where {$_.id -eq 'STRAG15022020'}
write-host $MatchTuple