Skip to content

Commit 22b5163

Browse files
authored
Fixes #10840 - Fix formatting (#10841)
* Change keyword to lowercase * Fix formatting * fix xrefs * Fix xrefs
1 parent 6abadc4 commit 22b5163

File tree

10 files changed

+594
-462
lines changed

10 files changed

+594
-462
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes how to create and use functions in PowerShell.
33
Locale: en-US
4-
ms.date: 01/20/2023
4+
ms.date: 01/31/2024
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-7.4&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about Functions
@@ -87,7 +87,7 @@ A function includes the following items:
8787
- Any number of named parameters (optional)
8888
- One or more PowerShell commands enclosed in braces `{}`
8989

90-
For more information about the `Dynamicparam` keyword and dynamic parameters in
90+
For more information about the `dynamicparam` keyword and dynamic parameters in
9191
functions, see [about_Functions_Advanced_Parameters][10].
9292

9393
## Simple functions

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

Lines changed: 12 additions & 11 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: 06/22/2023
4+
ms.date: 01/31/2024
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
@@ -82,7 +82,7 @@ function Get-Date_Func {
8282
}
8383
}
8484
85-
[cultureinfo]::CurrentCulture = 'de-DE'
85+
[CultureInfo]::CurrentCulture = 'de-DE'
8686
8787
# This German-format date string doesn't work with the invariant culture.
8888
# E.g., [datetime] '19-06-2018' breaks.
@@ -200,7 +200,7 @@ they can be difficult for users to discover. To find a dynamic parameter, the
200200
user must be in the provider path, use the **ArgumentList** parameter of the
201201
`Get-Command` cmdlet, or use the **Path** parameter of `Get-Help`.
202202

203-
To create a dynamic parameter for a function or script, use the `DynamicParam`
203+
To create a dynamic parameter for a function or script, use the `dynamicparam`
204204
keyword.
205205

206206
The syntax is as follows:
@@ -222,7 +222,7 @@ function Get-Sample {
222222
[CmdletBinding()]
223223
param([string]$Name, [string]$Path)
224224
225-
DynamicParam
225+
dynamicparam
226226
{
227227
if ($Path.StartsWith("HKLM:"))
228228
{
@@ -246,7 +246,8 @@ function Get-Sample {
246246
}
247247
```
248248

249-
For more information, see the documentation for the [RuntimeDefinedParameter][02] type.
249+
For more information, see the documentation for the
250+
[RuntimeDefinedParameter][02] type.
250251

251252
## Attributes of parameters
252253

@@ -739,7 +740,7 @@ For more information, see [about_Functions_Argument_Completion][11].
739740

740741
The **ArgumentCompleter** attribute allows you to add tab completion values to
741742
a specific parameter. An **ArgumentCompleter** attribute must be defined for
742-
each parameter that needs tab completion. Like **DynamicParameters**, the
743+
each parameter that needs tab completion. Like **dynamicparameters**, the
743744
available values are calculated at runtime when the user presses <kbd>Tab</kbd>
744745
after the parameter name.
745746

@@ -917,10 +918,10 @@ PowerShell generates an error if any value is outside that range.
917918

918919
The **ValidateRangeKind** enum allows for the following values:
919920

920-
- **Positive** - A number greater than zero.
921-
- **Negative** - A number less than zero.
922-
- **NonPositive** - A number less than or equal to zero.
923-
- **NonNegative** - A number greater than or equal to zero.
921+
- `Positive` - A number greater than zero.
922+
- `Negative` - A number less than zero.
923+
- `NonPositive` - A number less than or equal to zero.
924+
- `NonNegative` - A number greater than or equal to zero.
924925

925926
In the following example, the value of the **Attempts** parameter must be
926927
between zero and ten.
@@ -1273,7 +1274,7 @@ intended for external usage.
12731274
- [about_Functions_OutputTypeAttribute][13]
12741275

12751276
<!-- link references -->
1276-
[01]: ./about_comment_based_help.md
1277+
[01]: about_comment_based_help.md
12771278
[02]: /dotnet/api/system.management.automation.runtimedefinedparameter
12781279
[03]: /dotnet/standard/base-types/composite-formatting#composite-format-string
12791280
[04]: /dotnet/standard/base-types/composite-formatting#format-string-component

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Defines what a script block is and explains how to use script blocks in the PowerShell programming language.
33
Locale: en-US
4-
ms.date: 11/28/2023
4+
ms.date: 01/31/2024
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_blocks?view=powershell-7.4&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about Script Blocks
@@ -50,8 +50,8 @@ keyword to assign named parameters, as shown in the following syntax:
5050
> In a script block, unlike a function, you can't specify parameters outside
5151
> the braces.
5252
53-
Like functions, script blocks can include the `DynamicParam`, `Begin`,
54-
`Process`, and `End` keywords. For more information, see [about_Functions][02]
53+
Like functions, script blocks can include the `dynamicparam`, `begin`,
54+
`process`, and `end` keywords. For more information, see [about_Functions][02]
5555
and [about_Functions_Advanced][01].
5656

5757
## Using Script Blocks

reference/docs-conceptual/developer/cmdlet/cmdlet-dynamic-parameters.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ To support dynamic parameters, the following elements must be included in the cm
5858

5959
### Interface
6060

61-
[System.Management.Automation.IDynamicParameters](/dotnet/api/System.Management.Automation.IDynamicParameters).
62-
This interface provides the method that retrieves the dynamic parameters.
61+
[System.Management.Automation.IDynamicParameters][03]. This interface provides the method that
62+
retrieves the dynamic parameters.
6363

6464
For example:
6565

6666
`public class SendGreetingCommand : Cmdlet, IDynamicParameters`
6767

6868
### Method
6969

70-
[System.Management.Automation.IDynamicParameters.GetDynamicParameters](/dotnet/api/System.Management.Automation.IDynamicParameters.GetDynamicParameters).
71-
This method retrieves the object that contains the dynamic parameter definitions.
70+
[System.Management.Automation.IDynamicParameters.GetDynamicParameters][04]. This method retrieves
71+
the object that contains the dynamic parameter definitions.
7272

7373
For example:
7474

@@ -107,14 +107,18 @@ public class SendGreetingCommandDynamicParameters
107107
}
108108
```
109109

110-
For a complete example of a cmdlet that supports dynamic parameters, see [How to Declare Dynamic Parameters](./how-to-declare-dynamic-parameters.md).
110+
For a complete example of a cmdlet that supports dynamic parameters, see
111+
[How to Declare Dynamic Parameters][01].
111112

112113
## See also
113114

114-
[System.Management.Automation.IDynamicParameters](/dotnet/api/System.Management.Automation.IDynamicParameters)
115+
- [System.Management.Automation.IDynamicParameters][03]
116+
- [System.Management.Automation.IDynamicParameters.GetDynamicParameters][04]
117+
- [How to Declare Dynamic Parameters][01]
118+
- [Writing a Windows PowerShell Cmdlet][02]
115119

116-
[System.Management.Automation.IDynamicParameters.GetDynamicParameters](/dotnet/api/System.Management.Automation.IDynamicParameters.GetDynamicParameters)
117-
118-
[How to Declare Dynamic Parameters](./how-to-declare-dynamic-parameters.md)
119-
120-
[Writing a Windows PowerShell Cmdlet](./writing-a-windows-powershell-cmdlet.md)
120+
<!-- link references -->
121+
[01]: ./how-to-declare-dynamic-parameters.md
122+
[02]: ./writing-a-windows-powershell-cmdlet.md
123+
[03]: /dotnet/api/System.Management.Automation.IDynamicParameters
124+
[04]: /dotnet/api/System.Management.Automation.IDynamicParameters.GetDynamicParameters

reference/docs-conceptual/developer/cmdlet/how-to-declare-dynamic-parameters.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@ title: How to Declare Dynamic Parameters
66
---
77
# How to Declare Dynamic Parameters
88

9-
This example shows how to define dynamic parameters that are added to the cmdlet at runtime. In this example, the `Department` parameter is added to the cmdlet whenever the user specifies the `Employee` switch parameter. For more information about dynamic parameters, see [Cmdlet Dynamic Parameters](./cmdlet-dynamic-parameters.md).
9+
This example shows how to define dynamic parameters that are added to the cmdlet at runtime. In this
10+
example, the `Department` parameter is added to the cmdlet whenever the user specifies the
11+
`Employee` switch parameter. For more information about dynamic parameters, see
12+
[Cmdlet Dynamic Parameters][02].
1013

1114
## To define dynamic parameters
1215

13-
1. In the cmdlet class declaration, add the [System.Management.Automation.Idynamicparameters](/dotnet/api/System.Management.Automation.IDynamicParameters) interface as shown.
16+
1. In the cmdlet class declaration, add the [System.Management.Automation.Idynamicparameters][03]
17+
interface as shown.
1418

1519
```csharp
1620
public class SendGreetingCommand : Cmdlet, IDynamicParameters
1721
```
1822

19-
2. Call the [System.Management.Automation.Idynamicparameters.Getdynamicparameters*](/dotnet/api/System.Management.Automation.IDynamicParameters.GetDynamicParameters) method, which returns the object in which the dynamic parameters are defined. In this example, the method is called when the `Employee` parameter is specified.
23+
1. Call the [System.Management.Automation.Idynamicparameters.Getdynamicparameters*][04] method,
24+
which returns the object in which the dynamic parameters are defined. In this example, the method
25+
is called when the `Employee` parameter is specified.
2026

2127
```csharp
2228
public object GetDynamicParameters()
@@ -31,7 +37,8 @@ This example shows how to define dynamic parameters that are added to the cmdlet
3137
private SendGreetingCommandDynamicParameters context;
3238
```
3339

34-
3. Declare a class that defines the dynamic parameters to be added. You can use the attributes that you used to declare the static cmdlet parameters to declare the dynamic parameters.
40+
1. Declare a class that defines the dynamic parameters to be added. You can use the attributes that
41+
you used to declare the static cmdlet parameters to declare the dynamic parameters.
3542

3643
```csharp
3744
public class SendGreetingCommandDynamicParameters
@@ -49,7 +56,9 @@ This example shows how to define dynamic parameters that are added to the cmdlet
4956

5057
## Example
5158

52-
In this example, the `Department` parameter is added whenever the user specifies the `Employee` parameter. The `Department` parameter is an optional parameter, and the ValidateSet attribute is used to specify the allowed arguments.
59+
In this example, the `Department` parameter is added whenever the user specifies the `Employee`
60+
parameter. The `Department` parameter is an optional parameter, and the ValidateSet attribute is
61+
used to specify the allowed arguments.
5362

5463
```csharp
5564
using System;
@@ -126,10 +135,14 @@ namespace SendGreeting
126135

127136
## See Also
128137

129-
[System.Management.Automation.Runtimedefinedparameterdictionary](/dotnet/api/System.Management.Automation.RuntimeDefinedParameterDictionary)
130-
131-
[System.Management.Automation.Idynamicparameters.Getdynamicparameters*](/dotnet/api/System.Management.Automation.IDynamicParameters.GetDynamicParameters)
132-
133-
[Cmdlet Dynamic Parameters](./cmdlet-dynamic-parameters.md)
134-
135-
[Windows PowerShell SDK](../windows-powershell-reference.md)
138+
- [System.Management.Automation.RuntimeDefinedParameterDictionary][05]
139+
- [System.Management.Automation.IDynamicParameters.GetDynamicParameters*][04]
140+
- [Cmdlet Dynamic Parameters][02]
141+
- [Windows PowerShell SDK][01]
142+
143+
<!-- link references -->
144+
[01]: ../windows-powershell-reference.md
145+
[02]: cmdlet-dynamic-parameters.md
146+
[03]: xref:System.Management.Automation.IDynamicParameters
147+
[04]: xref:System.Management.Automation.IDynamicParameters.GetDynamicParameters
148+
[05]: xref:System.Management.Automation.RuntimeDefinedParameterDictionary

reference/docs-conceptual/developer/help/how-to-add-dynamic-parameters-to-a-provider-help-topic.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,5 @@ The following example shows the `DynamicParameters` element of the `Encoding` dy
180180
```
181181

182182
<!-- link references -->
183-
[01]: ./how-to-add-parameter-information.md
184-
[02]: /dotnet/api/microsoft.powershell.commands.filesystemcmdletproviderencoding
183+
[01]: how-to-add-parameter-information.md
184+
[02]: xref:Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding

0 commit comments

Comments
 (0)