Dan*_*iel 4 powershell json convertfrom-json
当我尝试使用以下代码片段将有效的json 文件转换为 powershell 内部表示时遇到问题:
[string]$changes = Get-Content -Path "C:\some\directory\with\file.json"
[PSCustomObject]$changes = ConvertFrom-Json -InputObject $Changes
Run Code Online (Sandbox Code Playgroud)
这会触发警告Cannot process argument because the value of argument "name" is not valid. Change the value of the "name" argument and run the operation again.
使用的Powershell版本是v5.1,它甚至不支持Name
标志,所以我有点困惑,似乎找不到解决方案。
任何帮助表示赞赏...
归档时间: |
|
查看次数: |
2978 次 |
最近记录: |