Performs an operation against each item in a collection of input objects, with a progress bar.
ForEach-Progress.ps1 [[-Activity] <String>] [[-Status] <ScriptBlock>] [[-Process] <ScriptBlock>]
-InputObject <PSObject> [-ProgressAction <ActionPreference>] [<CommonParameters>]
1..10 |ForEach-Progress.ps1 -Activity 'Testing' {"$_"} {Write-Host "item: $_"; sleep 2}
The progress title text to display.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A script block to generate status text from each $PSItem ($_).
Type: ScriptBlock
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A script block to execute for each $PSItem ($_).
Type: ScriptBlock
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
An item to process.
Type: PSObject
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
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.