October 2017
Intermediate to advanced
440 pages
11h 47m
English
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, StateId 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, StateName ...
Read now
Unlock full access