Make the 'PSISERemoteSessionOpenFile' a support event (#6582)

Make the `PSISERemoteSessionOpenFile` a support event, so that `Get-EventSubscriber` won't show that subscriber. `Get-EventSubscriber -Force` can still show the support event subscribers. `Unregister-Event -Force` needs to be used to remove a support event subscriber.

The event subscriber for `PSInternalRemoteDebuggerStopEvent` and `PSInternalRemoteDebuggerBreakpointUpdatedEvent` are already made support events. And this PR makes it the same for `PSISERemoteSessionOpenFile`.
This commit is contained in:
Dongbo Wang 2018-04-10 18:43:22 -07:00 committed by GitHub
parent 7726322589
commit 118f771939
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -943,7 +943,7 @@ namespace System.Management.Automation
[string] $PSEditFunction
)
Register-EngineEvent -SourceIdentifier PSISERemoteSessionOpenFile -Forward
Register-EngineEvent -SourceIdentifier PSISERemoteSessionOpenFile -Forward -SupportEvent
if ((Test-Path -Path 'function:\global:PSEdit') -eq $false)
{
@ -960,7 +960,7 @@ namespace System.Management.Automation
Remove-Item -Path 'function:\global:PSEdit' -Force
}
Unregister-Event -SourceIdentifier PSISERemoteSessionOpenFile -ErrorAction Ignore
Unregister-Event -SourceIdentifier PSISERemoteSessionOpenFile -Force -ErrorAction Ignore
";
/// <summary>