Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 3.0 » New-PSSession

New-PSSession - Powershell 3.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

New-PSSession

Short description
Creates a persistent connection to a local or remote computer.

Syntax
New-PSSession [[-ComputerName] <String[]>] [-ApplicationName <String>] [-Authentication <AuthenticationMechanism>] [-Ce
rtificateThumbprint <String>] [-ConfigurationName <String>] [-Credential <PSCredential>] [-EnableNetworkAccess] [-Name 
<String[]>] [-Port <Int32>] [-SessionOption <PSSessionOption>] [-ThrottleLimit <Int32>] [-UseSSL] [<CommonParameters>]
New-PSSession [-ConnectionUri] <Uri[]> [-AllowRedirection] [-Authentication <AuthenticationMechanism>] [-CertificateThu
mbprint <String>] [-ConfigurationName <String>] [-Credential <PSCredential>] [-EnableNetworkAccess] [-Name <String[]>] 
[-SessionOption <PSSessionOption>] [-ThrottleLimit <Int32>] [<CommonParameters>]
New-PSSession [[-Session] <PSSession[]>] [-EnableNetworkAccess] [-Name <String[]>] [-ThrottleLimit <Int32>] [<CommonPar
ameters>]





Description
The New-PSSession cmdlet creates a Windows PowerShell session (PSSession) on a local or remote computer.  When you crea
te a PSSession, Windows PowerShell establishes a persistent connection to the remote computer.


Use a PSSession to run multiple commands that share data, such as a function or the value of a variable. To run command
s in a PSSession, use the Invoke-Command cmdlet. To use the PSSession to interact directly with a remote computer, use 
the Enter-PSSession cmdlet. For more information, see about_PSSessions (http://go.microsoft.com/fwlink/?LinkID=135181).


You can run commands on a remote computer without creating a PSSession by using the ComputerName parameters of Enter-PS
Session or Invoke-Command. When you use the ComputerName parameter, Windows PowerShell creates a temporary connection t
hat is used for the command and is then closed.