Using powershell, how do I use select-object when top level isn't an array?

Not sure why I can't figure this out - should be simple.

Example JSON:

{
"entities": [
{
"id": "1377fe63-e89a-4da9-bfe1-7d9a3e885624",
"user": {},
"client": {
"id": ""
}
....

I want to select just the "id" item there for each entry in the entities array.

Can someone please help me with how the Select-Object should be formed to do this please?

Hello,

I don't have a windows OS so I can't answer/test myself.
But @PrinceMerluza wrote a good blog a while ago on using powershell with Genesys Cloud CLI.
There are some powershell examples available in the Genesys Cloud CLI Recipes.

Regards,

Hi,

I'm not hugely familiar with powershell but something like this command might help

gc.exe outbound callabletimesets list | ConvertFrom-Json | Select-Object -ExpandProperty entities | Select-Object -ExpandProperty id

Here I am printing the id's of all the callabletimesets returned. Hope this is what you need.

Regards,
Declan

Thanks Declan that was a huge help and got me on the right track.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.