$path= Resolve-Path “./test.json”
$json=ConvertFrom-Json(Get-Content($path) | Out-String)
$folder=”**”+$json.name+”**”
write-host $folder #Desired result 这个才能得到我要的结果, 下面三个都不行
write-host “**”+$json.name+”**”
write-host “**”+($json.name)+”**”
write-host “**”($json.name)”**”
#output:
**reddit**
** +@{date_added=13145624060145036; id=568; name=reddit; sync_transaction_version=3272; type=url; url=https://www.reddit.com/}.name+**
** + reddit +**
** reddit **
#test.json
{
“date_added”: “13145624060145036”,
“id”: “568”,
“name”: “reddit”,
“sync_transaction_version”: “3272”,
“type”: “url”,
“url”: “https://www.reddit.com/”
}