I am blogging about this because tree.exe comes with a nasty little issue that I want to remember (and you can benefit - how nice of me ;-)). Running the following produces a tree structure with garbage encoding:
PS:\>Tree $Path /F | Out-File C:\Temp\tree.txt
And adding the -Encoding parameter doesn't help. The only way I managed to make this useful is to pipe the tree output to the clipboard and paste it into notepad, like so:
PS:\>Tree $Path /F | Clip
Result!
This stackoverflow thread helps explain the issue nicely: http://stackoverflow.com/a/139302
BTW Tree.exe renders perfectly in VSTS Build and Release logs :-)
ReplyDelete