I go out on a limb here since you did not provide your input or a complete error message, but I assume that your problem is caused by a format mismatch between the output Get-Contentand the inputs ConvertFrom-Jsonwaiting.
Get-Contentreads the input file into an array of strings, while it ConvertFrom-Jsonexpects JSON data in one line. Furthermore, the conduit $jsonin ConvertFrom-Jsondoes not change the value $json.
, ( ):
$json = Get-Content 'C:\folder1\test.txt' | Out-String | ConvertFrom-Json
Write-Output $json