I run the following command to get a very basic audit of file permissions in PS:
Get-ChildItem -Directory E:\*,E:\*\*,E:\*\*\* |
Get-Acl | Format-list Path,AccessToString |
Out-File -Filepath c:\myfile.txt
The output of Format-List contains info in the path I want to strip out, namely Microsoft.PowerShell.Core\FileSystem::
But if I add {$_ -replace "Microsoft.PowerShell.Core\FileSystem::",""} before the output file pipe I get errors.
Is there a way to parse out this data through a piped output, or do I have to create a function?