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:
parent
7726322589
commit
118f771939
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue