Thanks Don…it was actually a huge typo. The error I’m trying to catch is permission denied:
Get-ChildItem : Access to the path 'C:\Windows\System32\LogFiles\WMI\RtBackup' is denied.
At T:\Scripts\Folders\Get-DirSize.ps1:62 char:18
+ $size = (Get-ChildItem $_.FullName -Recurse |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\Syst...es\WMI\RtBackup:String) [Get-ChildItem], Unaut
horizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
↧
Reply To: How do I catch this?
↧