It was bugging me that I couldn’t get try-catch work on the folder where I didn’t have permissions. Finally thought of the reason – set the ErrorAction to Ignore. Heres the revised script [ CmdletBinding ( ) ]
param (
[string] $path = "C:2012sg… Read the full text.