Skip to content

Commit 385c54f

Browse files
authored
Fix: Handle InvalidOperationException in RunPowershellCommandAsync (#14481)
1 parent 2acac82 commit 385c54f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Files.App/Utils/Shell/Win32API.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,11 @@ public static async Task<bool> RunPowershellCommandAsync(string command, bool ru
387387
{
388388
return false;
389389
}
390+
catch (InvalidOperationException ex)
391+
{
392+
App.Logger.LogWarning(ex, ex.Message);
393+
return false;
394+
}
390395
catch (Win32Exception)
391396
{
392397
// If user cancels UAC

0 commit comments

Comments
 (0)