New-RunspacePool
SYNOPSIS
Create a new runspace pool
SYNTAX
New-RunspacePool [[-ThrottleLimit] <Int32>] [[-ApartmentState] <ApartmentState>] [[-Variable] <PSVariable[]>]
[<CommonParameters>]
DESCRIPTION
Create a new runspace pool with the specified throttle limit, apartment state and variables
EXAMPLES
Example 1
PS C:\> New-RunspacePool -ThrottleLimit 10 -Variable (Get-Variable Credential, Path)
Creates a runspace pool with a maximum of 10 runspaces and transfers the variable Credential and Path to it.
PARAMETERS
-ApartmentState
The thread apartment state, e.g STA (single-threaded) or MTA (multi-threaded)
Type: ApartmentState
Parameter Sets: (All)
Aliases:
Accepted values: STA, MTA, Unknown
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ThrottleLimit
The throttle limit
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Variable
A list of variables transferred into each runspace pool. Shared by the entire pool
Type: PSVariable[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.