From 1203da7cc532e31965e5016f92b34df883e58a2b Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 6 Apr 2018 10:08:17 -0700 Subject: [PATCH] Make the 'PSISERemoteSessionOpenFile' a support event --- .../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 5421a6284c3..438b457e9e8 100644 --- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs +++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs @@ -943,7 +943,7 @@ public static Collection InvokeOnRunspace(PSCommand command, Runspace [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 @@ public static Collection InvokeOnRunspace(PSCommand command, Runspace Remove-Item -Path 'function:\global:PSEdit' -Force } - Unregister-Event -SourceIdentifier PSISERemoteSessionOpenFile -ErrorAction Ignore + Unregister-Event -SourceIdentifier PSISERemoteSessionOpenFile -Force -ErrorAction Ignore "; ///