en-US/EditorServicesProcess-help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems xmlns="http://msh" schema="maml">
 
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details><command:name>Enter-EditorServicesProcess</command:name>
<command:verb>Enter</command:verb>
<command:noun>EditorServicesProcess</command:noun>
<maml:description><maml:para>Enter a new runspace within a process hosted by the PowerShell Editor Services Integrated Console.
</maml:para>
</maml:description>
</command:details>
<maml:description><maml:para>The Enter-EditorServicesProcess function creates a new runspace within the integrated console. In this runspace you can interact with Editor Services from a standard PowerShell console.
</maml:para>
<maml:para>The runspace will not be the same one the integrated console uses, but it will have a functioning $psEditor variable and contain all the same loaded assemblies. You can also use the "Get-Runspace" and "Debug-Runspace" cmdlets to interact with the default runspace currently active in the integrated console.
</maml:para>
</maml:description>
<command:syntax><command:syntaxItem><maml:name>Enter-EditorServicesProcess</maml:name>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"><maml:name>ProcessId</maml:name>
<maml:Description><maml:para>Specifies ID of the process to enter.
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type><maml:name>Int32</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters><command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"><maml:name>ProcessId</maml:name>
<maml:Description><maml:para>Specifies ID of the process to enter.
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type><maml:name>Int32</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes><command:inputType><dev:type><maml:name>System.Int32</maml:name>
</dev:type>
<maml:description><maml:para>You can pass process ID's to this function. If multiple processes are passed, the first will be used and the rest will be ignored.
</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues><command:returnValue><dev:type><maml:name>None</maml:name>
</dev:type>
<maml:description><maml:para>This function does not return output to the pipeline.
</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:alertSet><maml:alert><maml:para>
</maml:para>
</maml:alert>
</maml:alertSet>
<command:examples><command:example><maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>Enter-EditorServicesProcess</dev:code>
<dev:remarks><maml:para>Enter the first process found with a instance of the $psEditor editor object.
</maml:para>
</dev:remarks>
</command:example>
<command:example><maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code>Get-EditorServicesProcess *MyProject* | Enter-EditorServicesProcess</dev:code>
<dev:remarks><maml:para>Enter the first process found with an instance of $psEditor that is also open to a workspace with a path that maches the glob.
</maml:para>
</dev:remarks>
</command:example>
<command:example><maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
<dev:code>Enter-EditorServicesProcess
$psEditor.GetEditorContext().CurrentFile.InsertText('Testing insert from PowerShell!')
exit</dev:code>
<dev:remarks><maml:para>Enter the first found Editor Services process, insert text into the currently open file, and exit back to the standard console.
</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks><maml:navigationLink><maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://github.com/SeeminglyScience/EditorServicesProcess/blob/master/docs/en-US/Enter-EditorServicesProcess.md</maml:uri>
</maml:navigationLink>
<maml:navigationLink><maml:linkText>Get-EditorServicesProcess</maml:linkText>
<maml:uri></maml:uri>
</maml:navigationLink>
<maml:navigationLink><maml:linkText>Get-Runspace</maml:linkText>
<maml:uri>https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.utility/get-runspace</maml:uri>
</maml:navigationLink>
<maml:navigationLink><maml:linkText>Debug-Runspace</maml:linkText>
<maml:uri>https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.utility/debug-runspace</maml:uri>
</maml:navigationLink>
</command:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details><command:name>Get-EditorServicesProcess</command:name>
<command:verb>Get</command:verb>
<command:noun>EditorServicesProcess</command:noun>
<maml:description><maml:para>Gets processes running PowerShell EditorServices.
</maml:para>
</maml:description>
</command:details>
<maml:description><maml:para>The Get-EditorServicesProcess function gets processes currently running on the system that are hosted within the PowerShell Editor Services Integrated Terminal. The returned object contains the process ID, AppDomain name, and current workspace path. This object can also be used with other functions in this module to manipulate the processes.
</maml:para>
</maml:description>
<command:syntax><command:syntaxItem><maml:name>Get-EditorServicesProcess</maml:name>
<command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"><maml:name>Workspace</maml:name>
<maml:Description><maml:para>Specifies a workspace path that the process must have open to be returned. This parameter accepts wildcards.
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type><maml:name>String</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>*</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem><maml:name>Get-EditorServicesProcess</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"><maml:name>ProcessId</maml:name>
<maml:Description><maml:para>Specifies the ID of the process to return.
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type><maml:name>Int32</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>0</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters><command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"><maml:name>Workspace</maml:name>
<maml:Description><maml:para>Specifies a workspace path that the process must have open to be returned. This parameter accepts wildcards.
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type><maml:name>String</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>*</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"><maml:name>ProcessId</maml:name>
<maml:Description><maml:para>Specifies the ID of the process to return.
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type><maml:name>Int32</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>0</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes><command:inputType><dev:type><maml:name>None</maml:name>
</dev:type>
<maml:description><maml:para>This function does not accept input from the pipeline.
</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues><command:returnValue><dev:type><maml:name>PSCustomObject</maml:name>
</dev:type>
<maml:description><maml:para>This function returns a PSCustomObject for each process found that matches the criteria. This object has the properties "ProcessId", "AppDomain", and "Workspace".
</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:alertSet><maml:alert><maml:para>
</maml:para>
</maml:alert>
</maml:alertSet>
<command:examples><command:example><maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>Get-EditorServicesProcess</dev:code>
<dev:remarks><maml:para>Returns all current instances of the integrated terminal.
</maml:para>
</dev:remarks>
</command:example>
<command:example><maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code>Get-EditorServicesProcess -Workspace *Projects*MyProject*</dev:code>
<dev:remarks><maml:para>Returns only instances that are open to a workspace that matches the specified pattern.
</maml:para>
</dev:remarks>
</command:example>
<command:example><maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
<dev:code>Get-EditorServicesProcess -ProcessId 23145 | Enter-EditorServicesProcess</dev:code>
<dev:remarks><maml:para>Enters the process with an ID of 23145 if it is within the integrated terminal.
</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks><maml:navigationLink><maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://github.com/SeeminglyScience/EditorServicesProcess/blob/master/docs/en-US/Get-EditorServicesProcess.md</maml:uri>
</maml:navigationLink>
<maml:navigationLink><maml:linkText>Enter-EditorServicesProcess</maml:linkText>
<maml:uri></maml:uri>
</maml:navigationLink>
</command:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details><command:name>Invoke-EditorServicesProcess</command:name>
<command:verb>Invoke</command:verb>
<command:noun>EditorServicesProcess</command:noun>
<maml:description><maml:para>Invoke a script block in the default runspace of processes hosted by the PowerShell Editor Services Integrated Console.
</maml:para>
</maml:description>
</command:details>
<maml:description><maml:para>The Invoke-EditorServicesProcess allows you to invoke a script in the default runspace of any process hosted by the PowerShell Editor Services Integrated Console.
</maml:para>
<maml:para>This is similar to the Enter-EditorServicesProcess function, with a few differences.
</maml:para>
<maml:para>- It can be ran on any number of processes
</maml:para>
<maml:para>- Invocation will take place in the default runspace of the Integrated Console, instead of a proxy runspace for the process.
</maml:para>
<maml:para>- It can be ran interactively.
</maml:para>
</maml:description>
<command:syntax><command:syntaxItem><maml:name>Invoke-EditorServicesProcess</maml:name>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"><maml:name>ScriptBlock</maml:name>
<maml:Description><maml:para>Specifies the script block to invoke.
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
<dev:type><maml:name>ScriptBlock</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="2" aliases="none"><maml:name>ProcessId</maml:name>
<maml:Description><maml:para>Specifies the process ID(s) of the Integrated Console(s).
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type><maml:name>Int32</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>0</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters><command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"><maml:name>ScriptBlock</maml:name>
<maml:Description><maml:para>Specifies the script block to invoke.
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
<dev:type><maml:name>ScriptBlock</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="2" aliases="none"><maml:name>ProcessId</maml:name>
<maml:Description><maml:para>Specifies the process ID(s) of the Integrated Console(s).
</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
<dev:type><maml:name>Int32</maml:name>
<maml:uri /></dev:type>
<dev:defaultValue>0</dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes><command:inputType><dev:type><maml:name>System.Int32</maml:name>
</dev:type>
<maml:description><maml:para>You can pipe Process ID's to this function, or objects with a property named "ProcessId"
</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues><command:returnValue><dev:type><maml:name>System.Object</maml:name>
</dev:type>
<maml:description><maml:para>This function will return any object returned by the specified scriptblock, though it will be deserialized.
</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:alertSet><maml:alert><maml:para>
</maml:para>
</maml:alert>
</maml:alertSet>
<command:examples><command:example><maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>$processes = Get-EditorServicesProcess
$processes | Invoke-EditorServicesProcess {
    $psEditor.Workspace.ShowInformationMessage('Hey there!')
}</dev:code>
<dev:remarks><maml:para>Shows a information message on all editor services windows.
</maml:para>
</dev:remarks>
</command:example>
<command:example><maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code>Get-EditorServicesProcess -Workspace '${workspaceRoot}' |
    Invoke-EditorServicesProcess { Invoke-Build -Task Build }</dev:code>
<dev:remarks><maml:para>Invoke a VSCode task in the context of the Integrated Console.
</maml:para>
</dev:remarks>
</command:example>
<command:example><maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title>
<dev:code>code .
Get-EditorServicesProcess -Workspace $pwd |
    Invoke-EditorServicesProcess { psedit (Get-ChildItem *.ps1) }</dev:code>
<dev:remarks><maml:para>Start VSCode in the current directory and open all *.ps1 files.
</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<command:relatedLinks><maml:navigationLink><maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://github.com/SeeminglyScience/EditorServicesProcess/docs/en-US/Invoke-EditorServicesProcess.md</maml:uri>
</maml:navigationLink>
<maml:navigationLink><maml:linkText>Enter-EditorServicesProcess</maml:linkText>
<maml:uri></maml:uri>
</maml:navigationLink>
<maml:navigationLink><maml:linkText>Get-EditorServicesProcess</maml:linkText>
<maml:uri></maml:uri>
</maml:navigationLink>
</command:relatedLinks>
</command:command>
</helpItems>