Hello,
Strange problem: I have a script that reads an object's ACL and saves it to a text file (Get-Acl objectname -Audit |FL > "textfile.txt"). Script has been working fine until I've bumped into the weird issue - occasionally the format of the resulting txt file is different from the one created previously (as I need to compare the old and the new files this leads to the false triggering), for example, if I run the script 6 times in a raw the format of the Sddl section will look as in the blue rectangle, but the 7th will look like in the red:

It does not matter whether there were any changes in ACLs or not - the format of SDDL strings can change without any (at least noticable) reason.
The two files do differ in formatting...
...but not in the content:
I've spent more than two days trying to pinpoint the situation in which those changes occur but to no avail, I just found out that the format may change any time in any way: it can change during the last 7 minutes or only the day after the script was run for the first time. The Sddl section may be made of 4-5-6 short strings, may be of 3-4 long ones. What can affect the way the PS formats a file???
Thank you in advance,
Michael


