CmdID

CmdID / PowerShell / Cmdlets / New

New-PSWorkflowExecutionOption

Creates an object that contains session configuration options for workflow sessions. PowerShell reference

From the PowerShell reference 16 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 session configuration options for workflow sessions. The New-PSWorkflowExecutionOption cmdlet creates an object that contains advanced options for workflow session configurations, that is session configurations designed to run Windows PowerShell Workflow workflows. You can use the PSWorkflowExecutionOption object that New-PSWorkflowExecutionOption generates as the value of the SessionTypeOption parameter of cmdlets that create or change a session configuration, such as the Register-PSSessionConfiguration and Set-PSSessionConfiguration cmdlets. Each parameter of the New-PSWorkflowExecutionOption cmdlet represents a property of the workflow session configuration option object that the cmdlet returns. If you omit a parameter, the cmdlet creates the object with a default value for the property. The New-PSWorkflowExecutionOption cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. For more information about workflow common parameters, see about_WorkflowCommonParameters. This cmdlet is introduced in Windows PowerShell 3.0.

New-PSWorkflowExecutionOption [-PersistencePath <String>] [-MaxPersistenceStoreSizeGB <Int64>] [-PersistWithEncryption] [-MaxRunningWorkflows <Int32>] [-AllowedActivity <String[]>] [-OutOfProcessActivity <String[]>] [-EnableValidation] [-MaxDisconnectedSessions <Int32>] [-MaxConnectedSessions <Int32>] [-MaxSessionsPerWorkflow <Int32>] [-MaxSessionsPerRemoteNode <Int32>] [-MaxActivityProcesses <Int32>] [-ActivityProcessIdleTimeoutSec <Int32>] [-RemoteNodeSessionIdleTimeoutSec <Int32>] [-SessionThrottleLimit <Int32>] [-WorkflowShutdownTimeoutMSec <Int32>] [<CommonParameters>]

Create a Workflow Options Object

New-PSWorkflowExecutionOption -MaxSessionsPerWorkflow 10 -MaxDisconnectedSessions 200Identify

Using a Workflow Options Object

# Create a Workflow Options object and save it in a variable $wo = New-PSWorkflowExecutionOption -MaxSessionsPerWorkflow 10 -MaxDisconnectedSessions 200 # Create the ITWorkflow session configuration Register-PSSessionConfiguration -Name ITWorkflows -SessionTypeOption $wo -ForceIdentify

Its page in the reference: New-PSWorkflowExecutionOption.

Parameters

16 in the PowerShell reference
-ActivityProcessIdleTimeoutSecDetermines how long each activity host process is maintained after the process becomes idle. When the interval expires, the process closes. Enter a value in seconds. The default value is 60.
-AllowedActivitySpecifies the activities that are permitted to run in the session. Enter namespace-qualified activity names, such as Microsoft.PowerShell.HyperV.Activities.*. Wildcard characters are supported. The default value, PSDefaultActivities, includes the built-in Windows Workflow Foundation activities and the activities that represent the core Windows PowerShell cmdlets.
-EnableValidationVerifies that all workflow activities in the session are included in the allowed activities list. The default value is True. To disable validation, use the following command format: -EnableValidation:$false.
-MaxActivityProcessesSpecifies the maximum number of processes that can be created in the session to support workflow activities. The default value is 5.
-MaxConnectedSessionsSpecifies the maximum number of remote sessions that are in an operational state. This quota is applied to sessions connected to all remote nodes (target computers). The default value is 100.
-MaxDisconnectedSessionsSpecifies the maximum number of remote sessions that are in a disconnected state. This quota is applied to sessions connected to all remote nodes (target computers). The default value is 1000.
-MaxPersistenceStoreSizeGBSpecifies the maximum size, in gigabytes, of the persistence store allocated to workflows that run in the session. When the size is exceeded, the persistence store is expanded to save all persisted data, but a warning is displayed and a message is written to the workflow event log. The default value is 10. The persistence store contains data for all workflow jobs. The ability to store data allows the jobs to resume without losing state.
-MaxRunningWorkflowsSpecifies that maximum number of workflows that can run in the session concurrently. The default value is 30.
-MaxSessionsPerRemoteNodeSpecifies the maximum number of sessions that can be connected to each remote node (target computer). The default value is 5.
-MaxSessionsPerWorkflowSpecifies the maximum number of session that can be created to support each workflow. The default value is 5.
-OutOfProcessActivityDetermines which allowed activities (specified by the AllowedActivities parameter) run out-of-process. The default value is InlineScript.
-PersistencePathSpecifies the location on disk where workflow state and data are stored. Storing the workflow state and data allows workflows to be suspended and resumed, and to recover from interruptions and network failures. The default value is $Env:LOCALAPPDATA\Microsoft\Windows\PowerShell\WF\PS.
-PersistWithEncryptionIndicates that the workflow encrypts the data in the persistence store. Consider using this feature when storing persistence data in a network share.
-RemoteNodeSessionIdleTimeoutSecSpecifies how long a session that is connected to a remote node (target computer) is maintained if it is idle. Enter a value in seconds. The default value is 60.
-SessionThrottleLimitSpecifies how many operations are created to support all workflows started in the session. The default value is 100.
-WorkflowShutdownTimeoutMSecSpecifies how long the session is maintained after all workflows in the session are forcibly suspended. When the timeout expires, Windows PowerShell closes the session, even if all workflows are not yet suspended. Enter a value in milliseconds. The default value is 500.