-
-
Notifications
You must be signed in to change notification settings - Fork 7
Invoke Parallel
external help file: XpandPwsh.Cmdlets.dll-Help.xml Module Name: XpandPwsh online version: https://go.microsoft.com/fwlink/?LinkID=2097043 schema: 2.0.0
Invokes tasks in parallel.
Invoke-Parallel [-ActivityName <String>] [-Script] <ScriptBlock> [-VariablesToImport <String[]>]
[-Value] <Object> [-ActivityId <Int32>] [-RetryOnError <Int32>] [-LimitConcurrency <Int32>]
[-RetryDelay <Int32>] [-StepInterval <Int32>] [-First <Int32>] [<CommonParameters>]
Invokes tasks in parallel. The function uses the System.Reactive library to handle parallelism.
PS C:\> $psObj=[PSCustomObject]@{
PackagesDirectory = (Get-Item "$PSScriptRoot\..\_third_party_assemblies\Packages").FullName
packageSources=[system.string]::join(";",$packageSources)
projects=$projects
}
$nuget=Get-XNugetPath
$psObj.Projects|Invoke-XParallel -ActivityName "Restoring Nugets" -VariablesToImport @("psObj","nuget") -Script {
& $nuget Restore $_ -PackagesDirectory $psObj.PackagesDirectory -source $psObj.packageSources
}
The above script restores in parallel all eXpandFrameowrk NuGets.
{{ Fill ActivityId Description }}
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill ActivityName Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Gets only the specified number of objects. Enter the number of objects to get.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill LimitConcurrency Description }}
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill RetryDelay Description }}
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill RetryOnError Description }}
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Script Description }}
Type: ScriptBlock
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill StepInterval Description }}
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Value Description }}
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
{{ Fill VariablesToImport Description }}
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.