Skip to content

Commit d9d8b91

Browse files
authored
More feedback on numeric parameters (#11632)
1 parent a27813c commit d9d8b91

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

reference/5.1/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Explains how to add parameters to advanced functions.
33
Locale: en-US
4-
ms.date: 01/02/2025
4+
ms.date: 01/04/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Functions_Advanced_Parameters
@@ -40,9 +40,9 @@ decimal digits, alphabetic characters, and underscores. For a complete list of
4040
naming rules, see [about_Variables][20].
4141

4242
> [!IMPORTANT]
43-
> It's possible to name a parameter using only decimal digits. Using numeric
44-
> parameter names isn't recommended because it can lead to confusion with
45-
> positional parameters.
43+
> It's possible to define a parameter that starts with a decimal digit.
44+
> Starting parameter names with a digit isn't recommended because PowerShell
45+
> treats them as string values passed as positional parameters.
4646
4747
Consider the following example:
4848

@@ -58,8 +58,8 @@ function TestFunction {
5858
}
5959
```
6060

61-
If you try to use the parameters, PowerShell interprets them as negative
62-
numbers passed as positional parameter.
61+
If you try to use the parameters, PowerShell interprets them as stings passed
62+
as positional parameter.
6363

6464
```powershell
6565
PS> TestFunction -100 -200 Hello

reference/7.4/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Explains how to add parameters to advanced functions.
33
Locale: en-US
4-
ms.date: 01/02/2025
4+
ms.date: 01/04/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7.4&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Functions_Advanced_Parameters
@@ -40,9 +40,9 @@ decimal digits, alphabetic characters, and underscores. For a complete list of
4040
naming rules, see [about_Variables][20].
4141

4242
> [!IMPORTANT]
43-
> It's possible to name a parameter using only decimal digits. Using numeric
44-
> parameter names isn't recommended because it can lead to confusion with
45-
> positional parameters.
43+
> It's possible to define a parameter that starts with a decimal digit.
44+
> Starting parameter names with a digit isn't recommended because PowerShell
45+
> treats them as string values passed as positional parameters.
4646
4747
Consider the following example:
4848

@@ -58,8 +58,8 @@ function TestFunction {
5858
}
5959
```
6060

61-
If you try to use the parameters, PowerShell interprets them as negative
62-
numbers passed as positional parameter.
61+
If you try to use the parameters, PowerShell interprets them as stings passed
62+
as positional parameter.
6363

6464
```powershell
6565
PS> TestFunction -100 -200 Hello

reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Explains how to add parameters to advanced functions.
33
Locale: en-US
4-
ms.date: 01/02/2025
4+
ms.date: 01/04/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7.5&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Functions_Advanced_Parameters
@@ -40,9 +40,9 @@ decimal digits, alphabetic characters, and underscores. For a complete list of
4040
naming rules, see [about_Variables][20].
4141

4242
> [!IMPORTANT]
43-
> It's possible to name a parameter using only decimal digits. Using numeric
44-
> parameter names isn't recommended because it can lead to confusion with
45-
> positional parameters.
43+
> It's possible to define a parameter that starts with a decimal digit.
44+
> Starting parameter names with a digit isn't recommended because PowerShell
45+
> treats them as string values passed as positional parameters.
4646
4747
Consider the following example:
4848

@@ -58,8 +58,8 @@ function TestFunction {
5858
}
5959
```
6060

61-
If you try to use the parameters, PowerShell interprets them as negative
62-
numbers passed as positional parameter.
61+
If you try to use the parameters, PowerShell interprets them as stings passed
62+
as positional parameter.
6363

6464
```powershell
6565
PS> TestFunction -100 -200 Hello

0 commit comments

Comments
 (0)