ConvertFrom-Json returns "Cannot process argument because the value of argument "name“无效。”

ConvertFrom-Json returns "Cannot process argument because the value of argument "name" is not valid."

我在尝试使用以下代码片段将 有效 json 文件转换为 powershell 内部表示时遇到问题:

[string]$changes = Get-Content -Path "C:\some\directory\with\file.json"
[PSCustomObject]$changes = ConvertFrom-Json -InputObject $Changes

这会触发警告 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 标志,所以我有点困惑,似乎无法找到一个解决方案。

感谢任何帮助...

关于此 thread,输入 json 包含此 powershell cmdlet 似乎不支持的空键。