When using PowerShell, people usually pipe their output into the PowerShell JSON converter to be able to use the output in scripting:
$listitems = m365 spo listitem list [options] | ConvertFrom-Json
However, the ConvertFrom-Json commandlet is not case-sensitive, and hence cannot handle multiple properties that are named the same. For example, the following response from the spo items api will break the commandlet:
[
{
"Id": 1
"ID": 1
"Title": "Some title"
}
]
to work around this you can use the ConvertFrom-Json -AsHashTable flag, but it's not ideal.
to fix this, in some places, the ID property is being deleted from the response, before being logged. For example in listitem-list and listitem-get.
listItems.forEach(v => delete v['ID']);
await logger.log(listItems);
There are a few places where it's not being deleted. We need to fix those.
Commands to update
There may be more, but this was all I found..
When using PowerShell, people usually pipe their output into the PowerShell JSON converter to be able to use the output in scripting:
However, the ConvertFrom-Json commandlet is not case-sensitive, and hence cannot handle multiple properties that are named the same. For example, the following response from the spo items api will break the commandlet:
[ { "Id": 1 "ID": 1 "Title": "Some title" } ]to work around this you can use the
ConvertFrom-Json -AsHashTableflag, but it's not ideal.to fix this, in some places, the ID property is being deleted from the response, before being logged. For example in listitem-list and listitem-get.
There are a few places where it's not being deleted. We need to fix those.
Commands to update
There may be more, but this was all I found..