Skip to content

Commit e28c9eb

Browse files
daxian-dbwTylerLeonhardt
authored andcommitted
Make the 'PSESRemoteSessionOpenFile' a support event (#652)
1 parent a0761cf commit e28c9eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PowerShellEditorServices/Session/RemoteFileManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ function New-EditorFile {
199199
[string] $PSEditModule
200200
)
201201
202-
Register-EngineEvent -SourceIdentifier PSESRemoteSessionOpenFile -Forward
202+
Register-EngineEvent -SourceIdentifier PSESRemoteSessionOpenFile -Forward -SupportEvent
203203
New-Module -ScriptBlock ([Scriptblock]::Create($PSEditModule)) -Name PSEdit | Import-Module -Global
204204
";
205205

206206
private const string RemovePSEditFunctionScript = @"
207207
Get-Module PSEdit | Remove-Module
208208
209-
Get-EventSubscriber -SourceIdentifier PSESRemoteSessionOpenFile -EA Ignore | Unregister-Event
209+
Unregister-Event -SourceIdentifier PSESRemoteSessionOpenFile -Force -ErrorAction Ignore
210210
";
211211

212212
private const string SetRemoteContentsScript = @"

0 commit comments

Comments
 (0)