Describes Windows PowerShell sessions (PSSessions) and explains how to
establish a persistent connection to a remote computer.
To run Windows PowerShell commands on a remote computer, you can use the
ComputerName parameter of a cmdlet, or you can create a Windows PowerShell
session (PSSession) and run commands in the PSSession.
When you create a PSSession, Windows PowerShell establishes a persistent
connection to the remote computer. Use a PSSession to run a series of
related commands on a remote computer. Commands that run in the same
PSSession can share data, such as the values of variables, aliases, and
You can also create a PSSession on the local computer and run commands
in it. A local PSSession uses the Windows PowerShell remoting
infrastructure to create and maintain the PSSession.
This topic explains how to create, use, get, and delete PSSessions.
For more advanced information, see about_PSSession_Details.
Note: PSSessions use the Windows PowerShell remoting infrastructure.
To use PSSessions, the local and remote computers must be configured
for remoting. For more information, see about_Remote_Requirements.
In Windows Vista and later versions of Windows, to create a
PSSession on a local computer, you must start Windows PowerShell
with the "Run as administrator" option.
WHAT IS A SESSION?
A session is an environment in which Windows PowerShell runs.
Each time you start Windows PowerShell, a session is created for you, and
you can run commands in the session. You can also add items to your session,
such as modules and snap-ins, and you can create items, such as variables,
functions, and aliases. These items exist only in the session and are
deleted when the session ends.
You can also create additional sessions, known as "Windows PowerShell
sessions" or "PSSessions," on the local computer or on a remote computer.
Like the default session, you can run commands in a PSSession and add and