Skip to content

Instantly share code, notes, and snippets.

@SeeminglyScience
SeeminglyScience / Enter-PSSessionWithEdit.ps1
Last active May 4, 2023 03:27
Proof of concept for "psedit" working outside of PSES.
function Enter-PSSessionWithEdit {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string] $ComputerName
)
end {
$enterEventName = 'RemoteSessionEditor.Enter'
if (-not $Host.Runspace.Events.GetEventSubscribers($enterEventName)) {