CmdID

CmdID / PowerShell / Cmdlets / Exit

Exit-PSSession

Ends an interactive session with a remote computer. PowerShell reference

From the PowerShell reference Alias exsn

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Ends an interactive session with a remote computer. The Exit-PSSession cmdlet ends interactive sessions that you started by using the Enter-PSSession cmdlet. You can also use the exit keyword to end an interactive session. The effect is the same as using Exit-PSSession.

Exit-PSSession [<CommonParameters>]

Start and stop an interactive session

PS C:> Enter-PSSession -ComputerName Server01 Server01\PS> Exit-PSSession PS C:>Identify

Start and stop an interactive session by using a PSSession object

PS C:> $s = New-PSSession -ComputerName Server01 PS C:> Enter-PSSession -Session $s Server01\PS> Exit-PSSession PS C:> $s Id Name ComputerName State ConfigurationName -- ---- ------------ ----- ----------------- 1 Session1 Server01 Opened Microsoft.PowerShellIdentify

Use the exit keyword to stop a session

PS C:> Enter-PSSession -ComputerName Server01 Server01\PS> exit PS C:>Identify

Its page in the reference: Exit-PSSession.