From 118f771939c86cd3680a75d54bb2eed5d1f57007 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 10 Apr 2018 18:43:22 -0700 Subject: [PATCH] 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`. --- .../engine/hostifaces/HostUtilities.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs index 5421a6284..438b457e9 100644 --- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs +++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs @@ -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 "; ///