5.0.16 Git changing order or configuration files

Product: PowerShell Universal
Version: 5.0.16

Hi,

Im having an issue with PowerShell universal where whenever i make a change to a script or app it seems to change the scripts.ps1, schedules.ps1 or dashboards.ps1. It doesn’t make any meaningful change it just changes the order they appear in the file. Whilst this doesnt break anything it does mean i have to make go through each commit to make sure nothing has been removed.

Example:

2 Likes

This isn’t new or unique to 5.0.16, but I do agree that it’s super annoying and I haven’t ever found a logical explanation for why it happens. With a config file such as this, it isn’t a big deal, but I’m afraid of it happening to something where the order of the lines actually does matter (such as text file).

Something interesting to note is that it does order them by First letter of the name.

Whereas the “before” image shows they were stored in partial reverse alphabetical order.

1 Like

The before image is the order in which i created these apps.

1 Like

PSU tries to put them into a deterministic order to prevent reordering in the future. There were issues where saving files would cause things to reorder even when nothing was actually changed. That said, it should always be like that and not unnecessarily be reordering things since that was the original intent on ordering them alphabetically.

If you are experiencing issues with this, please open an issue in the tracker.

1 Like