"The handle is invalid." error in PowerShell ISE

If you're testing scripts using PowerShell ISE and writing events, be careful as you might see this error even though it works pasting the code in PowerShell or executing the .ps1 file:

The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

Don't know what causes it but it can be ignored.

Comments