October 5th, 2013

PowerTip: Connect to PSSession if Availability is “None”

Doctor Scripto
Scripter

Summary: Learn how to connect to a PSSession if its Availability is None.

Hey, Scripting Guy! Question Can I connect to a PSSession if its Availability is None?

Hey, Scripting Guy! Answer None means that no other session is connected to the PSSession,
          so if the State is Disconnected and the Availability is None, use the Connect-PSSession cmdlet to connect to it:

PS C:> Get-PSSession -ComputerName Server01 -Name Diag

Id Name     ComputerName    State         ConfigurationName     Availability

— —-    ————    —–         —————–     ————

  1 Diag    Server01        Disconnected  Microsoft.PowerShell          None

 

PS C:> Connect-PSSession | Get-PSSession -ComputerName Server01 -Name Diag

Id Name            ComputerName    State         ConfigurationName     Availability

— —-            ————    —–         —————–     ————

9 Diag            Server01        Opened        Microsoft.PowerShell     Available

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.