Sessions created using New-PSSession persist until the PS session is removed (by Remove-PSSession) or the PowerShell session ends. The following example returns sessions created in the current PowerShell session:
PS> Get-PSSession | Select-Object Id, ComputerName, State
Id ComputerName State
-- ------------ -----
1 PSTEST Opened
If the ComputerName parameter is supplied, Get-PSSession will show sessions created on that computer. For example, if a session is created in one PowerShell console as follows:
$session = New-PSSession -ComputerName PSTest -Name Example
A second administrator console session will be able to view details of that session:
PS> Get-PSSession -ComputerName PSTest| Select-Object Name, ComputerName, State
Name ComputerName State
---- ------------ -----
Example PSTest Disconnected