lordmilko / PrtgAPI

C#/PowerShell interface for PRTG Network Monitor
MIT License
301 stars 37 forks source link

SortAlphabetically not sorting child groups when called on a parent group #390

Closed BlackDragonBE closed 4 months ago

BlackDragonBE commented 4 months ago

Describe the bug

The SortAlphabetically function seemingly doesn't work to sort child groups of a group. I tried using an object ID and a reference to a Group instance, but neither worked when I checked the result in the PRTG web interface. I expected the groups to be sorted alphabetically.

Steps to reproduce

var client = new PrtgClient("url.to.prtg", username, password);
client.SortAlphabetically(groupToSort); // This doesn't do anything

What is the output of 'Get-PrtgClient -Diagnostic'?

I'm using C# with v0.9.19 of the PrtgAPI.
If I run it in PowerShell, I get:

PSVersion      : 7.4.0
PSEdition      : Core
OS             : Microsoft Windows 10.0.22621
PrtgAPIVersion : 0.9.19
Culture        : nl-BE
CLRVersion     : .NETCoreApp,Version=v8.0
PrtgVersion    : 24.1.92.1554
PrtgLanguage   : english.lng

Additional context

No response

BlackDragonBE commented 4 months ago

Never mind, I'm an idiot. I tried to sort a newly created group instead of its parent...