< Back

New-MadThread

Sat Jan 18, 2020 9:53 am

NAME New-MadThread



SYNOPSIS

Start given PowerShell script in a new thread





SYNTAX

New-MadThread [[-ScriptBlockUnique] <ScriptBlock>] [[-RunspacePoolUnique] <RunspacePool>] [[-ParametersUnique]

<Hashtable>] [-UseEmbeddedParameters] [<CommonParameters>]





DESCRIPTION





PARAMETERS

-ScriptBlockUnique <ScriptBlock>

ScriptBlock to run in the new thread

Required



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RunspacePoolUnique <RunspacePool>

RunspacePool to use for the new thread

Required



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ParametersUnique <Hashtable>

Hashtable - Parameters for the new thread



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UseEmbeddedParameters [<SwitchParameter>]

Switch

If present, parameter names are derived from ScriptBlockUnique

and parameter values are set to matching variable values.



Matching variables must exist with correct values.



Thread parameter names cannot be 'ScriptBlockUnique',

'RunspacePoolUnique', 'ParametersUnique', or 'UseEmbeddedParameters'.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





v 1.0 3/23/18 Tim Curwick Created

v 1.1 4/30/18 Tim Curwick Added Runspace to return object

v 1.2 8/ 1/18 Tim Curwick Modified to improve performance from a module





RELATED LINKS