Skip to content

Commit

Permalink
(GH-11350) Clarify behavior of CurrentOperation with Minimal progress…
Browse files Browse the repository at this point in the history
… view

Prior to this change, the documentation didn't indicate that the **CurrentOperation**
parameter has no effect when the progress view is set to `Minimal`. When writing
progress, the **CurrentOperation** is only displayed below the progress bar in the
`Classic` progress view.

This change:

- Documents the behavior of the **CurrentOperation** parameter in `Classic` and
  `Minimal` progress views.
- Updates Example 2, which shows the behavior in the `Classic` view, adding a
  note to clearly indicate the behavior.
- Fixes AB#302101
- Resolves #11350
  • Loading branch information
michaeltlombardi committed Aug 26, 2024
1 parent 9d0a681 commit c011d3b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 27 deletions.
24 changes: 15 additions & 9 deletions reference/7.2/Microsoft.PowerShell.Utility/Write-Progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Utility
ms.date: 05/10/2023
ms.date: 08/26/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-progress?view=powershell-7.2&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Write-Progress
Expand Down Expand Up @@ -78,7 +78,7 @@ for($I = 0; $I -lt 10; $I++ ) {
$InnerLoopProgressParameters = @{
ID = 1
Activity = 'Updating'
Status = 'Progress'
Status = 'Inner Progress'
PercentComplete = $j
CurrentOperation = 'InnerLoop'
}
Expand All @@ -94,7 +94,7 @@ Progress ->
[ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
OuterLoop
Updating
Progress
Inner Progress
[oooooooooooooooooo ]
InnerLoop
```
Expand All @@ -105,8 +105,13 @@ loops, each represented by a progress bar.
The `Write-Progress` command for the second progress bar includes the **Id** parameter that
distinguishes it from the first progress bar.

Without the **Id** parameter, the progress bars would be superimposed on each other instead of being
displayed one below the other.
Without the **Id** parameter, the progress bars would be superimposed on each other instead of
being displayed one below the other.

> [!NOTE]
> This example sets the progress view to `Classic`, which displays the **CurrentOperation** values
> For each progress bar. When the progress view is set to `Minimal`, the **CurrentOperation**
> values aren't displayed.
### Example 3: Display the progress while searching for a string

Expand Down Expand Up @@ -215,8 +220,9 @@ Accept wildcard characters: False

### -CurrentOperation

Specifies the line of text below the progress bar. This text describes the operation that's
currently taking place.
Specifies the line of text below the progress bar in the `Classic` progress view. This text
describes the operation that's currently taking place. This parameter has no effect when the
progress view is set to `Minimal`.

```yaml
Type: System.String
Expand Down Expand Up @@ -251,8 +257,8 @@ Accept wildcard characters: False

### -ParentId

Specifies the parent activity of the current activity. Use the value `-1` if the current activity has
no parent activity.
Specifies the parent activity of the current activity. Use the value `-1` if the current activity
has no parent activity.

```yaml
Type: System.Int32
Expand Down
24 changes: 15 additions & 9 deletions reference/7.4/Microsoft.PowerShell.Utility/Write-Progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Utility
ms.date: 06/22/2023
ms.date: 08/26/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-progress?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Write-Progress
Expand Down Expand Up @@ -78,7 +78,7 @@ for($I = 0; $I -lt 10; $I++ ) {
$InnerLoopProgressParameters = @{
ID = 1
Activity = 'Updating'
Status = 'Progress'
Status = 'Inner Progress'
PercentComplete = $j
CurrentOperation = 'InnerLoop'
}
Expand All @@ -94,7 +94,7 @@ Progress ->
[ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
OuterLoop
Updating
Progress
Inner Progress
[oooooooooooooooooo ]
InnerLoop
```
Expand All @@ -105,8 +105,13 @@ loops, each represented by a progress bar.
The `Write-Progress` command for the second progress bar includes the **Id** parameter that
distinguishes it from the first progress bar.

Without the **Id** parameter, the progress bars would be superimposed on each other instead of being
displayed one below the other.
Without the **Id** parameter, the progress bars would be superimposed on each other instead of
being displayed one below the other.

> [!NOTE]
> This example sets the progress view to `Classic`, which displays the **CurrentOperation** values
> For each progress bar. When the progress view is set to `Minimal`, the **CurrentOperation**
> values aren't displayed.
### Example 3: Display the progress while searching for a string

Expand Down Expand Up @@ -215,8 +220,9 @@ Accept wildcard characters: False

### -CurrentOperation

Specifies the line of text below the progress bar. This text describes the operation that's
currently taking place.
Specifies the line of text below the progress bar in the `Classic` progress view. This text
describes the operation that's currently taking place. This parameter has no effect when the
progress view is set to `Minimal`.

```yaml
Type: System.String
Expand Down Expand Up @@ -251,8 +257,8 @@ Accept wildcard characters: False

### -ParentId

Specifies the parent activity of the current activity. Use the value `-1` if the current activity has
no parent activity.
Specifies the parent activity of the current activity. Use the value `-1` if the current activity
has no parent activity.

```yaml
Type: System.Int32
Expand Down
24 changes: 15 additions & 9 deletions reference/7.5/Microsoft.PowerShell.Utility/Write-Progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Utility
ms.date: 06/22/2023
ms.date: 08/26/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-progress?view=powershell-7.5&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Write-Progress
Expand Down Expand Up @@ -78,7 +78,7 @@ for($I = 0; $I -lt 10; $I++ ) {
$InnerLoopProgressParameters = @{
ID = 1
Activity = 'Updating'
Status = 'Progress'
Status = 'Inner Progress'
PercentComplete = $j
CurrentOperation = 'InnerLoop'
}
Expand All @@ -94,7 +94,7 @@ Progress ->
[ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo]
OuterLoop
Updating
Progress
Inner Progress
[oooooooooooooooooo ]
InnerLoop
```
Expand All @@ -105,8 +105,13 @@ loops, each represented by a progress bar.
The `Write-Progress` command for the second progress bar includes the **Id** parameter that
distinguishes it from the first progress bar.

Without the **Id** parameter, the progress bars would be superimposed on each other instead of being
displayed one below the other.
Without the **Id** parameter, the progress bars would be superimposed on each other instead of
being displayed one below the other.

> [!NOTE]
> This example sets the progress view to `Classic`, which displays the **CurrentOperation** values
> For each progress bar. When the progress view is set to `Minimal`, the **CurrentOperation**
> values aren't displayed.
### Example 3: Display the progress while searching for a string

Expand Down Expand Up @@ -215,8 +220,9 @@ Accept wildcard characters: False

### -CurrentOperation

Specifies the line of text below the progress bar. This text describes the operation that's
currently taking place.
Specifies the line of text below the progress bar in the `Classic` progress view. This text
describes the operation that's currently taking place. This parameter has no effect when the
progress view is set to `Minimal`.

```yaml
Type: System.String
Expand Down Expand Up @@ -251,8 +257,8 @@ Accept wildcard characters: False

### -ParentId

Specifies the parent activity of the current activity. Use the value `-1` if the current activity has
no parent activity.
Specifies the parent activity of the current activity. Use the value `-1` if the current activity
has no parent activity.

```yaml
Type: System.Int32
Expand Down

0 comments on commit c011d3b

Please sign in to comment.