Skip to content

Commit a531a69

Browse files
(AB-506232) Fix overlocalization in about_Functions_Advanced_Parameters
Prior to this change, the term `switch parameter` was overlocalized in Japanese, munging the meaning to `parameter switching`. This change: - Replaces use of the term `switch parameter` with `` `[switch]` parameter``, which avoids the overlocalization. - Fixes AB506232 by applying this change in formatting to the `about_Function_Advanced_Parameters` article. The terminology will be updated across the documentation in a following change set.
1 parent 98cbecc commit a531a69

File tree

4 files changed

+148
-148
lines changed

4 files changed

+148
-148
lines changed

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

Lines changed: 37 additions & 37 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: 03/10/2026
4+
ms.date: 04/08/2026
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
@@ -178,68 +178,68 @@ param(
178178
)
179179
```
180180

181-
## Switch parameters
181+
## `[switch]` parameters
182182

183-
Switch parameters are parameters that take no parameter value. Instead, they
184-
convey a Boolean true-or-false value through their presence or absence, so that
185-
when a switch parameter is present it has a **true** value and when absent it
186-
has a **false** value.
183+
`[switch]` parameters are parameters that take no parameter value. Instead,
184+
they convey a Boolean true-or-false value through their presence or absence, so
185+
that when a `[switch]` parameter is present it has a **true** value and when
186+
absent it has a **false** value.
187187

188-
For example, the **Recurse** parameter of `Get-ChildItem` is a switch
188+
For example, the **Recurse** parameter of `Get-ChildItem` is a `[switch]`
189189
parameter.
190190

191-
To create a switch parameter in a function, specify the `[switch]` type in the
192-
parameter definition. The following example shows the definition of a switch
193-
parameter that could be used to provide an option to output data as a byte
194-
array:
191+
The following example shows the definition of a `[switch]` parameter that could
192+
be used to provide an option to output data as a byte array:
195193

196194
```powershell
197195
param([switch]$AsByteArray)
198196
```
199197

200-
Switch parameters are easy to use and are preferred over Boolean parameters
198+
`[switch]` parameters are easy to use and are preferred over Boolean parameters
201199
that have a less natural syntax for PowerShell.
202200

203-
To use a switch parameter, include the parameter in the command. For example:
201+
To use a `[switch]` parameter, include the parameter in the command. For
202+
example:
204203

205204
`-IncludeAll`
206205

207206
To use a Boolean parameter, you must provide the parameter and a Boolean value.
208207

209208
`-IncludeAll $true`
210209

211-
When creating switch parameters, choose the parameter name carefully. Be sure
212-
that the parameter name communicates the effect of the parameter to the user.
213-
Avoid ambiguous terms, such as **Filter** or **Maximum** that might imply a
214-
value is required.
210+
When creating `[switch]` parameters, choose the parameter name carefully. Be
211+
sure that the parameter name communicates the effect of the parameter to the
212+
user. Avoid ambiguous terms, such as **Filter** or **Maximum** that might imply
213+
a value is required.
215214

216-
### Switch parameter design considerations
215+
### `[switch]` parameter design considerations
217216

218-
- Don't set a default value for a switch parameter. Switch parameter always
219-
default to false.
220-
- Don't make switch parameters positional. By default, switch parameters are
221-
excluded from positional parameters. You _can_ override that in the
222-
**Parameter** attribute, but it can confuse users.
223-
- Design switch parameters so that using parameter changes the default behavior
217+
- Don't set a default value for a `[switch]` parameter. `[switch]` parameters
218+
always default to false.
219+
- Don't make `[switch]` parameters positional. By default, `[switch]`
220+
parameters are excluded from positional parameters. You _can_ override that
221+
in the **Parameter** attribute, but it can confuse users.
222+
- Design `[switch]` parameters so that using them changes the default behavior
224223
of the command to a less common or more complicated mode. The simplest
225224
behavior of a command should be the default behavior that doesn't require the
226-
use of switch parameters.
227-
- Don't make switch parameters mandatory. The only case where it's helpful to
228-
make a switch parameter mandatory is when it's needed to differentiate a
229-
parameter set.
230-
- Use the switch parameter variable directly in a conditional expression. The
231-
`SwitchParameter` type implicitly converts to Boolean. For example:
225+
use of `[switch]` parameters.
226+
- Don't make `[switch]` parameters mandatory. The only case where it's helpful
227+
to make a `[switch]` parameter mandatory is when it's needed to differentiate
228+
a parameter set.
229+
- Use the `[switch]` parameter variable directly in a conditional expression.
230+
The `SwitchParameter` type implicitly converts to Boolean. For example:
232231

233232
```powershell
234233
if ($MySwitch) { ... }
235234
```
236235

237-
- Always base the behavior controlled by the switch on the value of the switch,
238-
not the presence of the parameter. There are several ways to test for the
239-
presence of a switch parameters:
236+
- Always base the behavior controlled by the `[switch]` parameter on the
237+
_value_ of the parameter, not its _presence_. There are several ways to test
238+
for the presence of a `[switch]` parameters:
240239

241-
- `$PSBoundParameters` contains the switch parameter name as a key
242-
- `$MyInvocation.BoundParameters` contains the switch parameter name as a key
240+
- `$PSBoundParameters` contains the `[switch]` parameter name as a key
241+
- `$MyInvocation.BoundParameters` contains the `[switch]` parameter name as a
242+
key
243243
- `$PSCmdlet.ParameterSetName` when the switch defines a unique parameter set
244244

245245
For example, it's possible to provide an explicit value for the switch using
@@ -773,7 +773,7 @@ Use the **System.Obsolete** attribute to mark parameters that are no longer
773773
supported. This can be useful when you want to remove a parameter from a
774774
function but you don't want to break existing scripts that use the function.
775775

776-
For example, consider a function that has a **NoTypeInformation** switch
776+
For example, consider a function that has a **NoTypeInformation** `[switch]`
777777
parameter that controls whether type information is included in the output. You
778778
want to make that behavior the default and remove the parameter from the
779779
function. However, you don't want to break existing scripts that use the
@@ -783,7 +783,7 @@ explains the change.
783783
```powershell
784784
param(
785785
[System.Obsolete("The NoTypeInformation parameter is obsolete.")]
786-
[SwitchParameter]$NoTypeInformation
786+
[switch]$NoTypeInformation
787787
)
788788
```
789789

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

Lines changed: 37 additions & 37 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: 03/10/2026
4+
ms.date: 04/08/2026
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
@@ -173,68 +173,68 @@ param(
173173
)
174174
```
175175

176-
## Switch parameters
176+
## `[switch]` parameters
177177

178-
Switch parameters are parameters that take no parameter value. Instead, they
179-
convey a Boolean true-or-false value through their presence or absence, so that
180-
when a switch parameter is present it has a **true** value and when absent it
181-
has a **false** value.
178+
`[switch]` parameters are parameters that take no parameter value. Instead,
179+
they convey a Boolean true-or-false value through their presence or absence, so
180+
that when a `[switch]` parameter is present it has a **true** value and when
181+
absent it has a **false** value.
182182

183-
For example, the **Recurse** parameter of `Get-ChildItem` is a switch
183+
For example, the **Recurse** parameter of `Get-ChildItem` is a `[switch]`
184184
parameter.
185185

186-
To create a switch parameter in a function, specify the `[switch]` type in the
187-
parameter definition. The following example shows the definition of a switch
188-
parameter that could be used to provide an option to output data as a byte
189-
array:
186+
The following example shows the definition of a `[switch]` parameter that could
187+
be used to provide an option to output data as a byte array:
190188

191189
```powershell
192190
param([switch]$AsByteArray)
193191
```
194192

195-
Switch parameters are easy to use and are preferred over Boolean parameters
193+
`[switch]` parameters are easy to use and are preferred over Boolean parameters
196194
that have a less natural syntax for PowerShell.
197195

198-
To use a switch parameter, include the parameter in the command. For example:
196+
To use a `[switch]` parameter, include the parameter in the command. For
197+
example:
199198

200199
`-IncludeAll`
201200

202201
To use a Boolean parameter, you must provide the parameter and a Boolean value.
203202

204203
`-IncludeAll $true`
205204

206-
When creating switch parameters, choose the parameter name carefully. Be sure
207-
that the parameter name communicates the effect of the parameter to the user.
208-
Avoid ambiguous terms, such as **Filter** or **Maximum** that might imply a
209-
value is required.
205+
When creating `[switch]` parameters, choose the parameter name carefully. Be
206+
sure that the parameter name communicates the effect of the parameter to the
207+
user. Avoid ambiguous terms, such as **Filter** or **Maximum** that might imply
208+
a value is required.
210209

211-
### Switch parameter design considerations
210+
### `[switch]` parameter design considerations
212211

213-
- Don't set a default value for a switch parameter. Switch parameter always
214-
default to false.
215-
- Don't make switch parameters positional. By default, switch parameters are
216-
excluded from positional parameters. You _can_ override that in the
217-
**Parameter** attribute, but it can confuse users.
218-
- Design switch parameters so that using parameter changes the default behavior
212+
- Don't set a default value for a `[switch]` parameter. `[switch]` parameters
213+
always default to false.
214+
- Don't make `[switch]` parameters positional. By default, `[switch]`
215+
parameters are excluded from positional parameters. You _can_ override that
216+
in the **Parameter** attribute, but it can confuse users.
217+
- Design `[switch]` parameters so that using them changes the default behavior
219218
of the command to a less common or more complicated mode. The simplest
220219
behavior of a command should be the default behavior that doesn't require the
221-
use of switch parameters.
222-
- Don't make switch parameters mandatory. The only case where it's helpful to
223-
make a switch parameter mandatory is when it's needed to differentiate a
224-
parameter set.
225-
- Use the switch parameter variable directly in a conditional expression. The
226-
`SwitchParameter` type implicitly converts to Boolean. For example:
220+
use of `[switch]` parameters.
221+
- Don't make `[switch]` parameters mandatory. The only case where it's helpful
222+
to make a `[switch]` parameter mandatory is when it's needed to differentiate
223+
a parameter set.
224+
- Use the `[switch]` parameter variable directly in a conditional expression.
225+
The `SwitchParameter` type implicitly converts to Boolean. For example:
227226

228227
```powershell
229228
if ($MySwitch) { ... }
230229
```
231230

232-
- Always base the behavior controlled by the switch on the value of the switch,
233-
not the presence of the parameter. There are several ways to test for the
234-
presence of a switch parameters:
231+
- Always base the behavior controlled by the `[switch]` parameter on the
232+
_value_ of the parameter, not its _presence_. There are several ways to test
233+
for the presence of a `[switch]` parameters:
235234

236-
- `$PSBoundParameters` contains the switch parameter name as a key
237-
- `$MyInvocation.BoundParameters` contains the switch parameter name as a key
235+
- `$PSBoundParameters` contains the `[switch]` parameter name as a key
236+
- `$MyInvocation.BoundParameters` contains the `[switch]` parameter name as a
237+
key
238238
- `$PSCmdlet.ParameterSetName` when the switch defines a unique parameter set
239239

240240
For example, it's possible to provide an explicit value for the switch using
@@ -802,7 +802,7 @@ Use the **System.Obsolete** attribute to mark parameters that are no longer
802802
supported. This can be useful when you want to remove a parameter from a
803803
function but you don't want to break existing scripts that use the function.
804804

805-
For example, consider a function that has a **NoTypeInformation** switch
805+
For example, consider a function that has a **NoTypeInformation** `[switch]`
806806
parameter that controls whether type information is included in the output. You
807807
want to make that behavior the default and remove the parameter from the
808808
function. However, you don't want to break existing scripts that use the
@@ -812,7 +812,7 @@ explains the change.
812812
```powershell
813813
param(
814814
[System.Obsolete("The NoTypeInformation parameter is obsolete.")]
815-
[SwitchParameter]$NoTypeInformation
815+
[switch]$NoTypeInformation
816816
)
817817
```
818818

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

Lines changed: 37 additions & 37 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: 03/10/2026
4+
ms.date: 04/08/2026
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
@@ -173,68 +173,68 @@ param(
173173
)
174174
```
175175

176-
## Switch parameters
176+
## `[switch]` parameters
177177

178-
Switch parameters are parameters that take no parameter value. Instead, they
179-
convey a Boolean true-or-false value through their presence or absence, so that
180-
when a switch parameter is present it has a **true** value and when absent it
181-
has a **false** value.
178+
`[switch]` parameters are parameters that take no parameter value. Instead,
179+
they convey a Boolean true-or-false value through their presence or absence, so
180+
that when a `[switch]` parameter is present it has a **true** value and when
181+
absent it has a **false** value.
182182

183-
For example, the **Recurse** parameter of `Get-ChildItem` is a switch
183+
For example, the **Recurse** parameter of `Get-ChildItem` is a `[switch]`
184184
parameter.
185185

186-
To create a switch parameter in a function, specify the `[switch]` type in the
187-
parameter definition. The following example shows the definition of a switch
188-
parameter that could be used to provide an option to output data as a byte
189-
array:
186+
The following example shows the definition of a `[switch]` parameter that could
187+
be used to provide an option to output data as a byte array:
190188

191189
```powershell
192190
param([switch]$AsByteArray)
193191
```
194192

195-
Switch parameters are easy to use and are preferred over Boolean parameters
193+
`[switch]` parameters are easy to use and are preferred over Boolean parameters
196194
that have a less natural syntax for PowerShell.
197195

198-
To use a switch parameter, include the parameter in the command. For example:
196+
To use a `[switch]` parameter, include the parameter in the command. For
197+
example:
199198

200199
`-IncludeAll`
201200

202201
To use a Boolean parameter, you must provide the parameter and a Boolean value.
203202

204203
`-IncludeAll $true`
205204

206-
When creating switch parameters, choose the parameter name carefully. Be sure
207-
that the parameter name communicates the effect of the parameter to the user.
208-
Avoid ambiguous terms, such as **Filter** or **Maximum** that might imply a
209-
value is required.
205+
When creating `[switch]` parameters, choose the parameter name carefully. Be
206+
sure that the parameter name communicates the effect of the parameter to the
207+
user. Avoid ambiguous terms, such as **Filter** or **Maximum** that might imply
208+
a value is required.
210209

211-
### Switch parameter design considerations
210+
### `[switch]` parameter design considerations
212211

213-
- Don't set a default value for a switch parameter. Switch parameter always
214-
default to false.
215-
- Don't make switch parameters positional. By default, switch parameters are
216-
excluded from positional parameters. You _can_ override that in the
217-
**Parameter** attribute, but it can confuse users.
218-
- Design switch parameters so that using parameter changes the default behavior
212+
- Don't set a default value for a `[switch]` parameter. `[switch]` parameters
213+
always default to false.
214+
- Don't make `[switch]` parameters positional. By default, `[switch]`
215+
parameters are excluded from positional parameters. You _can_ override that
216+
in the **Parameter** attribute, but it can confuse users.
217+
- Design `[switch]` parameters so that using them changes the default behavior
219218
of the command to a less common or more complicated mode. The simplest
220219
behavior of a command should be the default behavior that doesn't require the
221-
use of switch parameters.
222-
- Don't make switch parameters mandatory. The only case where it's helpful to
223-
make a switch parameter mandatory is when it's needed to differentiate a
224-
parameter set.
225-
- Use the switch parameter variable directly in a conditional expression. The
226-
`SwitchParameter` type implicitly converts to Boolean. For example:
220+
use of `[switch]` parameters.
221+
- Don't make `[switch]` parameters mandatory. The only case where it's helpful
222+
to make a `[switch]` parameter mandatory is when it's needed to differentiate
223+
a parameter set.
224+
- Use the `[switch]` parameter variable directly in a conditional expression.
225+
The `SwitchParameter` type implicitly converts to Boolean. For example:
227226

228227
```powershell
229228
if ($MySwitch) { ... }
230229
```
231230

232-
- Always base the behavior controlled by the switch on the value of the switch,
233-
not the presence of the parameter. There are several ways to test for the
234-
presence of a switch parameters:
231+
- Always base the behavior controlled by the `[switch]` parameter on the
232+
_value_ of the parameter, not its _presence_. There are several ways to test
233+
for the presence of a `[switch]` parameters:
235234

236-
- `$PSBoundParameters` contains the switch parameter name as a key
237-
- `$MyInvocation.BoundParameters` contains the switch parameter name as a key
235+
- `$PSBoundParameters` contains the `[switch]` parameter name as a key
236+
- `$MyInvocation.BoundParameters` contains the `[switch]` parameter name as a
237+
key
238238
- `$PSCmdlet.ParameterSetName` when the switch defines a unique parameter set
239239

240240
For example, it's possible to provide an explicit value for the switch using
@@ -802,7 +802,7 @@ Use the **System.Obsolete** attribute to mark parameters that are no longer
802802
supported. This can be useful when you want to remove a parameter from a
803803
function but you don't want to break existing scripts that use the function.
804804

805-
For example, consider a function that has a **NoTypeInformation** switch
805+
For example, consider a function that has a **NoTypeInformation** `[switch]`
806806
parameter that controls whether type information is included in the output. You
807807
want to make that behavior the default and remove the parameter from the
808808
function. However, you don't want to break existing scripts that use the
@@ -812,7 +812,7 @@ explains the change.
812812
```powershell
813813
param(
814814
[System.Obsolete("The NoTypeInformation parameter is obsolete.")]
815-
[SwitchParameter]$NoTypeInformation
815+
[switch]$NoTypeInformation
816816
)
817817
```
818818

0 commit comments

Comments
 (0)