CmdID

CmdID / PowerShell / Cmdlets / New

New-PSTransportOption

Creates an object that contains advanced options for a session configuration. PowerShell reference

From the PowerShell reference 10 parameters

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Creates an object that contains advanced options for a session configuration. The New-PSTransportOption cmdlet creates an object that contains transport options for session configurations. You can use the object as the value of the TransportOption parameter of cmdlets that create or change a session configuration, such as the Register-PSSessionConfiguration and Set-PSSessionConfiguration cmdlets. You can also change the transport option settings by editing the values of the session configuration properties in the WSMan: drive. For more information, see WSMan Provider. The session configuration options represent the session values set on the server-side, or receiving end of a remote connection. The client-side, or sending end of the connection, can set session option values when the session is created, or when the client disconnects from or reconnects to the session. Unless stated otherwise, when the setting values conflict, the client-side values take precedence. However, the client-side values cannot violate maximum values and quotas set in the session configuration. Without parameters, New-PSTransportOption generates a transport option object that has null values for all of the options. If you omit a parameter, the object has a null value for the property that the parameter represents. A null value does not affect the session configuration. For more information about session options, see New-PSSessionOption. For more information about session configurations, see about_Session_Configurations. This cmdlet was introduced in Windows PowerShell 3.0.

New-PSTransportOption [-MaxIdleTimeoutSec <Int32>] [-ProcessIdleTimeoutSec <Int32>] [-MaxSessions <Int32>] [-MaxConcurrentCommandsPerSession <Int32>] [-MaxSessionsPerUser <Int32>] [-MaxMemoryPerSessionMB <Int32>] [-MaxProcessesPerSession <Int32>] [-MaxConcurrentUsers <Int32>] [-IdleTimeoutSec <Int32>] [-OutputBufferingMode <OutputBufferingMode>] [<CommonParameters>]

Generate a default transport option

New-PSTransportOptionIdentify

Get session configuration options

$t = New-PSTransportOption -MaxSessions 40 Register-PSSessionConfiguration -Name ITTasks -TransportOption $t Get-PSSessionConfiguration -Name ITTasks | Format-List -Property *Identify

Setting a transport option

$t = New-PSTransportOption -IdleTimeoutSec 3600 Set-PSSessionConfiguration -Name ITTasks -TransportOption $t $s = New-PSSession -Name MyITTasks -ConfigurationName ITTasks $s | Format-List -Property *Identify

Its page in the reference: New-PSTransportOption.

Parameters

10 in the PowerShell reference
-IdleTimeoutSecDetermines how long each session stays open if the remote computer does not receive any communication from the local computer. This includes the heartbeat signal. When the interval expires, the session closes. The idle time-out value is of significant importance when the user intends to disconnect and reconnect to a session. The user can reconnect only if the session has not timed out. The IdleTimeoutSec parameter corresponds to the IdleTimeoutMs property of a session configuration. Enter a value in seconds. The default value is 7200 (2 hours). The minimum value is 60 (1 minute). The maximum is the value of the IdleTimeout property of Shell objects in the WSMan configuration (WSMan:\\<ComputerName>\Shell\IdleTimeout). The default value is 7200000 milliseconds (2 hours). If an idle time-out value is set in the session options and in the session configuration, value set in the session options takes precedence, but it cannot exceed the value of the MaxIdleTimeoutMs property of the session configuration. To set the value of the MaxIdleTimeoutMs property, use the MaxIdleTimeoutSec parameter.
-MaxConcurrentCommandsPerSessionLimits the number of commands that can run at the same time in each session to the specified value. The default value is 1000. The MaxConcurrentCommandsPerSession parameter corresponds to the MaxConcurrentCommandsPerShell property of a session configuration.
-MaxConcurrentUsersLimits the number of users who can run commands at the same time in each session to the specified value. The default value is 5.
-MaxIdleTimeoutSecLimits the idle time-out set for each session to the specified value. The default value is [int]::MaxValue (~25 days). The idle time-out value is of significant importance when the user intends to disconnect and reconnect to a session. The user can reconnect only if the session has not timed out. The MaxIdleTimeoutSec parameter corresponds to the MaxIdleTimeoutMs property of a session configuration.
-MaxMemoryPerSessionMBLimits the memory used by each session to the specified value. Enter a value in megabytes. The default value is 1024 megabytes (1 GB). The MaxMemoryPerSessionMB parameter corresponds to the MaxMemoryPerShellMB property of a session configuration.
-MaxProcessesPerSessionLimits the number of processes running in each session to the specified value. The default value is 15. The MaxProcessesPerSession parameter corresponds to the MaxProcessesPerShell property of a session configuration.
-MaxSessionsLimits the number of sessions that use the session configuration. The default value is 25. The MaxSessions parameter corresponds to the MaxShells property of a session configuration.
-MaxSessionsPerUserLimits the number of sessions that use the session configuration and run with the credentials of a given user to the specified value. The default value is 25. When you specify this value, consider that many users might be using the credentials of a run as user. The MaxSessionsPerUser parameter corresponds to the MaxShellsPerUser property of a session configuration.
-OutputBufferingModeDetermines how command output is managed in disconnected sessions when the output buffer becomes full. The acceptable values for this parameter are: - Block When the output buffer is full, execution is suspended until the buffer is clear. - Drop When the output buffer is full, execution continues. As new output is saved, the oldest output is discarded. - None No output buffering mode is specified. The default value of the OutputBufferingMode property of sessions is Block.
-ProcessIdleTimeoutSecLimits the time-out for each host process to the specified value. The default value, 0, means that there is no time-out value for the process. Other session configurations have per-process time-out values. For example, the Microsoft.PowerShell.Workflow session configuration has a per-process time-out value of 28800 seconds (8 hours).