From c011d3b175dcbd965c1f2eb642a0b355e9984c65 Mon Sep 17 00:00:00 2001 From: Mikey Lombardi Date: Mon, 26 Aug 2024 13:20:57 -0500 Subject: [PATCH] (GH-11350) Clarify behavior of CurrentOperation with Minimal progress 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 --- .../Write-Progress.md | 24 ++++++++++++------- .../Write-Progress.md | 24 ++++++++++++------- .../Write-Progress.md | 24 ++++++++++++------- 3 files changed, 45 insertions(+), 27 deletions(-) diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/7.2/Microsoft.PowerShell.Utility/Write-Progress.md index b03a224ea553..7d2beccdb344 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Write-Progress.md @@ -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 @@ -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' } @@ -94,7 +94,7 @@ Progress -> [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] OuterLoop Updating -Progress +Inner Progress [oooooooooooooooooo ] InnerLoop ``` @@ -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 @@ -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 @@ -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 diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/7.4/Microsoft.PowerShell.Utility/Write-Progress.md index 8e1869985ba7..dcff5790e5d2 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Write-Progress.md @@ -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 @@ -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' } @@ -94,7 +94,7 @@ Progress -> [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] OuterLoop Updating -Progress +Inner Progress [oooooooooooooooooo ] InnerLoop ``` @@ -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 @@ -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 @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/7.5/Microsoft.PowerShell.Utility/Write-Progress.md index 720a015ac927..c7e9cbe9267a 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Write-Progress.md @@ -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 @@ -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' } @@ -94,7 +94,7 @@ Progress -> [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] OuterLoop Updating -Progress +Inner Progress [oooooooooooooooooo ] InnerLoop ``` @@ -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 @@ -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 @@ -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