Hi,
I have this script to search drives for PST files
Get-PSDrive -PSProvider "filesystem"|%{get-childitem $_.root -include *.pst -r}|select name, directoryname, @{name="Size (GB)";expression ={"{0:N2}" -f ($_.length/1GB)}}
I want it to tell me what folder it is searching and highlight whenever it come across a folder it doesn't have access to.
I get the error message "get-childitem <folder> is denied and the full reason but I want it to look neater and just display something like "Access denied to <folder>" or "Searching <folder>"
TIA
Andy
- Moved by Jason Johnston [MSFT]Microsoft employee Tuesday, February 10, 2015 2:17 PM Question about powershell and directories