PowerShell/Polaris

Polaris leaves behind a couple of event subscribers

pcgeek86 opened this issue · 0 comments

Polaris Bug Report

Description of the bug


After running Stop-Polaris and Clear-Polaris, the Polaris module leaves behind a couple of event subscriptions. These should be cleaned up during Clear-Polaris, I believe.

Steps to reproduce

Steps to reproduce the behavior:

New-PolarisGetRoute -Path / -ScriptBlock { }
Start-Polaris
Stop-Polaris
Clear-Polaris

Now run Get-EventSubscriber, and there are a couple of registrations active.

SubscriptionId   : 2
SourceObject     : System.Management.Automation.PowerShell
EventName        : InvocationStateChanged
SourceIdentifier : fee5b04f-61a9-4ab3-a68a-1ee1bc9f3508
Action           : System.Management.Automation.PSEventJob
HandlerDelegate  :
SupportEvent     : False
ForwardEvent     : False

SubscriptionId   : 3
SourceObject     : CallbackEventBridge
EventName        : callbackcomplete
SourceIdentifier : cc883506-5c5e-48a0-b471-930beca121e1
Action           : System.Management.Automation.PSEventJob
HandlerDelegate  :
SupportEvent     : False
ForwardEvent     : False

Expected behavior

No leftover event subscribers are registered in PowerShell.

Version Information


Run the following script and copy and paste the results here:

PSCompatibleVersionsPlatformPSRemotingProtocolVersionSerializationVersionWSManStackVersionPSEditionPSVersionOSGitCommitId
1.0.-1.-1, 2.0.-1.-1, 3.0.-1.-1, 4.0.-1.-1, 5.0.-1.-1, 5.1.10032.0, 6.0.0.-1, 6.1.0.-1, 6.2.0.-1, 7.0.0.-1, 7.1.0.-1Win32NT2.31.1.0.13.0Core7.1.0Microsoft Windows 10.0.190417.1.0