diff --git a/src/System.Management.Automation/engine/Subsystem/SubsystemManager.cs b/src/System.Management.Automation/engine/Subsystem/SubsystemManager.cs index 8764cf83cf..d211cb532a 100644 --- a/src/System.Management.Automation/engine/Subsystem/SubsystemManager.cs +++ b/src/System.Management.Automation/engine/Subsystem/SubsystemManager.cs @@ -280,7 +280,14 @@ namespace System.Management.Automation.Subsystem ISubsystem impl = subsystemInfo.UnregisterImplementation(id); if (impl is IDisposable disposable) { - disposable.Dispose(); + try + { + disposable.Dispose(); + } + catch + { + // It's OK to ignore all exceptions when disposing the object. + } } }