...the last point... :
...it just does not work.
Thank you all for your help!
Regards,
Michael
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
...the last point... :
...it just does not work.
Thank you all for your help!
Regards,
Michael
P.S.
And the cherry on the cake:
As you see on the screenshot above the files were copied to C:\111 (and first compared) at 2:21 PM. I've been running this code since that time ~ 10 times (at ~3:00PM, 3:30PM, 16:05, ...18:03PM), the result was False. At 18:07 the result became True. The question is closed.
Hi BillStewart,
"I think it would help if you view formatted output as convenient for viewing but not for further processing. Another way to say this is: If you want to do something with the data, select the properties you want directly (don't use the formatting cmdlets for that use case)." - I guess you're right.
But it means that this -
"The format cmdlets, such as Format-List, arrange the data to be displayed but do not display it. The data is displayed by the output features of PowerShell and by the cmdlets that contain the Out verb (the Out cmdlets), such as Out-Host or Out-File. "
Regards,
Michael