AndrewPla / TOPdeskPS

PowerShell module to interact with the TOPdesk API
MIT License
30 stars 12 forks source link

Improve Get-TdPersonGroup #96

Closed AndrewPla closed 5 years ago

AndrewPla commented 5 years ago

Prerequisites

Put an X between the brackets on each line to confirm you have completed them:

Describe the bug Hi Andrew,

I’m a big fan of Powershell and turned in your TopdeskPS module.

Now I want to use the cmdlet Get-TDPersonGroup and found out, that this command : Get-TdPersonGroup -name "ICT Infra" doesn’t give a result.

I think I know what the problem is. This is what the developers site of Topdesk says:

And when you give this command:

$RESULT = Invoke-RestMethod -Uri "https://xxxxxxxxxxxxxxx/tas/api/persongroups” -Method Get -Headers $headers

It returns only 10 groups, so the next command $RESULT | ? {$_.name -eq $group } is in most cases in vain.

But when you give this command:

Invoke-RestMethod -Uri "https://xxxxxxxxxxxxxxx/tas/api/persongroups?name=$Group" -Method Get -Headers $headers

It returns the info I want.

I think your cmdlet Get-TDPersonGroup is like the first example.

I’m a big fan of Powershell, but find it very difficult to fix this issue in your module.

Can you help?