diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md index 6a14dfe88f71..92d90c00e0c6 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Functions.md @@ -1,7 +1,7 @@ --- description: Describes how to create and use functions in PowerShell. Locale: en-US -ms.date: 04/17/2025 +ms.date: 07/16/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions @@ -509,22 +509,33 @@ function Get-SumOfNumbers { begin { $retValue = 0 } process { - if ($null -ne $Numbers) { + if ($MyInvocation.ExpectingInput) { + "Pipeline input: $_" + $retValue += $_ + } else { foreach ($n in $Numbers) { + "Command line input: $n" $retValue += $n } - } else { - $retValue += $_ } } - end { $retValue } + end { "Sum = $retValue" } } -PS> 1, 2, 3, 4 | Get-SumOfNumbers -10 -PS> Get-SumOfNumbers 1, 2, 3, 4 -10 + +PS> 1,2,3,4 | Get-SumOfNumbers +Pipeline input: 1 +Pipeline input: 2 +Pipeline input: 3 +Pipeline input: 4 +Sum = 10 +PS> Get-SumOfNumbers 1,2,3,4 +Command line input: 1 +Command line input: 2 +Command line input: 3 +Command line input: 4 +Sum = 10 ``` When you use a function in a pipeline, the objects piped to the function are diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Operators.md index 54e98e5b63cb..bd46a83bea9f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Operators.md @@ -194,7 +194,7 @@ PS> $i In the prefix case, the value of `$i` is incremented before being output. In the postfix case, the value of `$i` is incremented after being output. -You can also use this technique In the context of a conditional statement, such +You can also use this technique in the context of a conditional statement, such as the `if` statement. ```powershell diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md index 6525ccda9f58..c952b411ccaf 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Functions.md @@ -1,7 +1,7 @@ --- description: Describes how to create and use functions in PowerShell. Locale: en-US -ms.date: 04/17/2025 +ms.date: 07/16/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions @@ -533,22 +533,33 @@ function Get-SumOfNumbers { begin { $retValue = 0 } process { - if ($null -ne $Numbers) { + if ($MyInvocation.ExpectingInput) { + "Pipeline input: $_" + $retValue += $_ + } else { foreach ($n in $Numbers) { + "Command line input: $n" $retValue += $n } - } else { - $retValue += $_ } } - end { $retValue } + end { "Sum = $retValue" } } -PS> 1, 2, 3, 4 | Get-SumOfNumbers -10 -PS> Get-SumOfNumbers 1, 2, 3, 4 -10 + +PS> 1,2,3,4 | Get-SumOfNumbers +Pipeline input: 1 +Pipeline input: 2 +Pipeline input: 3 +Pipeline input: 4 +Sum = 10 +PS> Get-SumOfNumbers 1,2,3,4 +Command line input: 1 +Command line input: 2 +Command line input: 3 +Command line input: 4 +Sum = 10 ``` When you use a function in a pipeline, the objects piped to the function are diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Operators.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Operators.md index 582b2eaa58d9..706fd740deee 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Operators.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Operators.md @@ -171,7 +171,7 @@ PS> $i In the prefix case, the value of `$i` is incremented before being output. In the postfix case, the value of `$i` is incremented after being output. -You can also use this technique In the context of a conditional statement, such +You can also use this technique in the context of a conditional statement, such as the `if` statement. ```powershell diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md index fe15587f72df..1fdad8bafa47 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md @@ -1,7 +1,7 @@ --- description: Describes how to create and use functions in PowerShell. Locale: en-US -ms.date: 04/17/2025 +ms.date: 07/16/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions @@ -533,22 +533,33 @@ function Get-SumOfNumbers { begin { $retValue = 0 } process { - if ($null -ne $Numbers) { + if ($MyInvocation.ExpectingInput) { + "Pipeline input: $_" + $retValue += $_ + } else { foreach ($n in $Numbers) { + "Command line input: $n" $retValue += $n } - } else { - $retValue += $_ } } - end { $retValue } + end { "Sum = $retValue" } } -PS> 1, 2, 3, 4 | Get-SumOfNumbers -10 -PS> Get-SumOfNumbers 1, 2, 3, 4 -10 + +PS> 1,2,3,4 | Get-SumOfNumbers +Pipeline input: 1 +Pipeline input: 2 +Pipeline input: 3 +Pipeline input: 4 +Sum = 10 +PS> Get-SumOfNumbers 1,2,3,4 +Command line input: 1 +Command line input: 2 +Command line input: 3 +Command line input: 4 +Sum = 10 ``` When you use a function in a pipeline, the objects piped to the function are diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Operators.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Operators.md index 01fd2fa646a1..d7fa10af476c 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Operators.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Operators.md @@ -171,7 +171,7 @@ PS> $i In the prefix case, the value of `$i` is incremented before being output. In the postfix case, the value of `$i` is incremented after being output. -You can also use this technique In the context of a conditional statement, such +You can also use this technique in the context of a conditional statement, such as the `if` statement. ```powershell diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md index 26d85605329d..81e902901c95 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Functions.md @@ -1,7 +1,7 @@ --- description: Describes how to create and use functions in PowerShell. Locale: en-US -ms.date: 04/17/2025 +ms.date: 07/16/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Functions @@ -533,22 +533,33 @@ function Get-SumOfNumbers { begin { $retValue = 0 } process { - if ($null -ne $Numbers) { + if ($MyInvocation.ExpectingInput) { + "Pipeline input: $_" + $retValue += $_ + } else { foreach ($n in $Numbers) { + "Command line input: $n" $retValue += $n } - } else { - $retValue += $_ } } - end { $retValue } + end { "Sum = $retValue" } } -PS> 1, 2, 3, 4 | Get-SumOfNumbers -10 -PS> Get-SumOfNumbers 1, 2, 3, 4 -10 + +PS> 1,2,3,4 | Get-SumOfNumbers +Pipeline input: 1 +Pipeline input: 2 +Pipeline input: 3 +Pipeline input: 4 +Sum = 10 +PS> Get-SumOfNumbers 1,2,3,4 +Command line input: 1 +Command line input: 2 +Command line input: 3 +Command line input: 4 +Sum = 10 ``` When you use a function in a pipeline, the objects piped to the function are diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Operators.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Operators.md index 238654cfb8e5..edbf1019ea24 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Operators.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Operators.md @@ -171,7 +171,7 @@ PS> $i In the prefix case, the value of `$i` is incremented before being output. In the postfix case, the value of `$i` is incremented after being output. -You can also use this technique In the context of a conditional statement, such +You can also use this technique in the context of a conditional statement, such as the `if` statement. ```powershell diff --git a/reference/docs-conceptual/community/2025-updates.md b/reference/docs-conceptual/community/2025-updates.md index 2e1af81d59d2..4a9053d3a828 100644 --- a/reference/docs-conceptual/community/2025-updates.md +++ b/reference/docs-conceptual/community/2025-updates.md @@ -1,6 +1,6 @@ --- description: List of changes to the PowerShell documentation for 2025 -ms.date: 06/02/2025 +ms.date: 07/17/2025 title: What's New in PowerShell-Docs for 2025 --- # What's new in PowerShell Docs for 2025 @@ -14,6 +14,31 @@ get started. [01]: contributing/overview.md +## 2025-June + +No new content this month. Only minor edits and bug fixes. + +GitHub stats + +- 18 PRs merged (5 from Community) +- 22 issues opened (22 from Community) +- 22 issues closed (22 Community issues closed) + +Top Community Contributors + +The following people contributed to PowerShell docs this month by submitting pull requests or +filing issues. Thank you! + +| GitHub Id | PRs merged | Issues opened | +| ----------- | :--------: | :-----------: | +| skycommand | 2 | | +| JustinGrote | 1 | | +| OranguTech | 1 | | +| changeworld | 1 | | +| ThomasNieto | 1 | | +| SamErde | 1 | | +| vlad1300 | | 2 | + ## 2025-May Content updates diff --git a/reference/docs-conceptual/community/hall-of-fame.md b/reference/docs-conceptual/community/hall-of-fame.md index e0615a09861b..54ca282d58ba 100644 --- a/reference/docs-conceptual/community/hall-of-fame.md +++ b/reference/docs-conceptual/community/hall-of-fame.md @@ -1,6 +1,6 @@ --- description: List of the GitHub users that have the most contributions to the PowerShell-Doc project. -ms.date: 06/02/2025 +ms.date: 07/17/2025 title: Community contributor Hall of Fame --- # Community Contributor Hall of Fame @@ -17,7 +17,7 @@ Pull Requests help us fix those issues and make the documentation better for eve | PRs Merged | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | Grand Total | | ------------------ | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ----------: | -| Community | 3 | 194 | 446 | 467 | 321 | 160 | 99 | 122 | 108 | 81 | 115 | 2116 | +| Community | 3 | 194 | 446 | 467 | 321 | 160 | 99 | 121 | 108 | 81 | 120 | 2120 | | matt9ucci | | | 157 | 80 | 30 | 1 | 6 | | | | | 274 | | nschonni | | | | 14 | 138 | 10 | | | | | | 162 | | kiazhi | | 25 | 79 | 12 | | | | | | | | 116 | @@ -28,9 +28,9 @@ Pull Requests help us fix those issues and make the documentation better for eve | ehmiiz | | | | | | | | 22 | 14 | | | 36 | | ArieHein | | | | | 1 | | | | | 7 | 25 | 33 | | yecril71pl | | | | | | 21 | 3 | 3 | | | | 27 | +| skycommand | | | 1 | 3 | 3 | 6 | | 1 | 4 | 1 | 2 | 21 | +| changeworld | | | | | | | | 3 | | | 17 | 20 | | Dan1el42 | | 20 | | | | | | | | | | 20 | -| changeworld | | | | | | | | 3 | | | 16 | 19 | -| skycommand | | | 1 | 3 | 3 | 6 | | 1 | 4 | 1 | | 19 | | NReilingh | | 2 | | 13 | 3 | | | | | | | 18 | | it-praktyk | | | | 16 | 1 | | | | | | | 17 | | vors | | 15 | 1 | | | | | | | | | 16 | @@ -48,7 +48,7 @@ GitHub issues help us identify errors and gaps in our documentation. | Issues Opened | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | Grand Total | | ------------------ | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ----------: | -| Community | 3 | 54 | 95 | 211 | 562 | 557 | 363 | 225 | 270 | 221 | 86 | 2647 | +| Community | 3 | 54 | 95 | 211 | 562 | 557 | 363 | 225 | 270 | 220 | 95 | 2655 | | mklement0 | | | 19 | 60 | 56 | 61 | 28 | 8 | 20 | 24 | 2 | 278 | | ehmiiz | | | | | | | | 20 | 14 | | | 34 | | iSazonov | | | 1 | 4 | 10 | 8 | 4 | 3 | | 1 | | 31 | @@ -70,8 +70,8 @@ GitHub issues help us identify errors and gaps in our documentation. | jsilverm | | | | | | 8 | | | 4 | | | 12 | | CarloToso | | | | | | | | | 11 | | | 11 | | Liturgist | | | | | 1 | 1 | 1 | 2 | 4 | 2 | | 11 | -| vors | 1 | 6 | 2 | 1 | | | | | | | | 10 | | ArmaanMcleod | | | | | | | | | 4 | 6 | | 10 | +| vors | 1 | 6 | 2 | 1 | | | | | | | | 10 | | UberKluger | | | | | | 1 | 7 | 2 | | | | 10 | -| LaurentDardenne | | | 3 | 2 | | | | 5 | | | | 10 | | matt9ucci | | | 2 | 5 | | | 2 | | 1 | | | 10 | +| LaurentDardenne | | | 3 | 2 | | | | 5 | | | | 10 |