diff --git a/src/System.Management.Automation/utils/PathUtils.cs b/src/System.Management.Automation/utils/PathUtils.cs index 45ba787aee..0034681e12 100644 --- a/src/System.Management.Automation/utils/PathUtils.cs +++ b/src/System.Management.Automation/utils/PathUtils.cs @@ -444,6 +444,10 @@ namespace System.Management.Automation { // file is in use on Windows } + catch (UnauthorizedAccessException) + { + // user does not have permissions + } } return false;