Skip to content

Commit

Permalink
fixes #11234 add terms to no-loc and new cmd example (#11235)
Browse files Browse the repository at this point in the history
* add terms to no-loc and add new example (#11234)

Add missing metadata to no-loc for CommandWithArgs, and fix example for launching from cmd.exe

* Editorial update

---------

Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com>
  • Loading branch information
ninmonkey and sdwheeler committed Jul 5, 2024
1 parent 7ea0d42 commit ba86d1f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
19 changes: 17 additions & 2 deletions reference/7.4/Microsoft.PowerShell.Core/About/about_Pwsh.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: Explains how to use the `pwsh` command-line interface. Displays the command-line parameters and describes the syntax.
Locale: en-US
ms.date: 01/10/2024
no-loc: [-File, -f, -Command, -c, -ConfigurationName, -config, -CustomPipeName, -EncodedCommand, -e, -ec, -ExecutionPolicy, -ex, -ep, -InputFormat, -inp, -if, -Interactive, -i, -Login, -l, -MTA, -NoExit, -noe, -NoLogo, -nol, -NonInteractive, -noni, -NoProfile, -nop, -OutputFormat, -o, -of, -SettingsFile, -settings, -SSHServerMode, -sshs, -STA, -Version, -v, -WindowStyle, -w, -WorkingDirectory, -wd, -Help]
ms.date: 07/05/2024
no-loc: [-File, -f, -Command, -c, -CommandWithArgs, -cwa, -ConfigurationName, -config, -CustomPipeName, -EncodedCommand, -e, -ec, -ExecutionPolicy, -ex, -ep, -InputFormat, -inp, -if, -Interactive, -i, -Login, -l, -MTA, -NoExit, -noe, -NoLogo, -nol, -NonInteractive, -noni, -NoProfile, -nop, -OutputFormat, -o, -of, -SettingsFile, -settings, -SSHServerMode, -sshs, -STA, -Version, -v, -WindowStyle, -w, -WorkingDirectory, -wd, -Help]
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_pwsh?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Pwsh
Expand Down Expand Up @@ -221,6 +221,20 @@ arg: arg1
arg: arg2
```

> [!NOTE]
> [Argument parsing with quotes][05] causes the example to fail if run from
> `cmd.exe` or `powershell.exe`. To run from those, you can use
```Cmd
REM Quoting required when run from cmd.exe
pwsh -CommandWithArgs "$args | % { ""arg: $_"" }" arg1 arg2
```

```powershell
# Quoting required when run from powershell.exe
pwsh -CommandWithArgs '"$args | % { ""arg: $_"" }"' arg1 arg2
```

### -ConfigurationName | -config

Specifies a configuration endpoint in which PowerShell is run. This can be any
Expand Down Expand Up @@ -410,3 +424,4 @@ prepend the command parameters with a hyphen (`-`), not a forward slash (`/`).
[02]: about_Automatic_Variables.md#lastexitcode
[03]: about_operators.md#special-operators
[04]: https://linux.die.net/man/1/chsh
[05]: about_Parsing.md#passing-arguments-that-contain-quote-characters
19 changes: 17 additions & 2 deletions reference/7.5/Microsoft.PowerShell.Core/About/about_Pwsh.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: Explains how to use the `pwsh` command-line interface. Displays the command-line parameters and describes the syntax.
Locale: en-US
ms.date: 01/10/2024
no-loc: [-File, -f, -Command, -c, -ConfigurationName, -config, -CustomPipeName, -EncodedCommand, -e, -ec, -ExecutionPolicy, -ex, -ep, -InputFormat, -inp, -if, -Interactive, -i, -Login, -l, -MTA, -NoExit, -noe, -NoLogo, -nol, -NonInteractive, -noni, -NoProfile, -nop, -OutputFormat, -o, -of, -SettingsFile, -settings, -SSHServerMode, -sshs, -STA, -Version, -v, -WindowStyle, -w, -WorkingDirectory, -wd, -Help]
ms.date: 07/05/2024
no-loc: [-File, -f, -Command, -c, -CommandWithArgs, -cwa, -ConfigurationName, -config, -CustomPipeName, -EncodedCommand, -e, -ec, -ExecutionPolicy, -ex, -ep, -InputFormat, -inp, -if, -Interactive, -i, -Login, -l, -MTA, -NoExit, -noe, -NoLogo, -nol, -NonInteractive, -noni, -NoProfile, -nop, -OutputFormat, -o, -of, -SettingsFile, -settings, -SSHServerMode, -sshs, -STA, -Version, -v, -WindowStyle, -w, -WorkingDirectory, -wd, -Help]
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_pwsh?view=powershell-7.5&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Pwsh
Expand Down Expand Up @@ -221,6 +221,20 @@ arg: arg1
arg: arg2
```

> [!NOTE]
> [Argument parsing with quotes][05] causes the example to fail if run from
> `cmd.exe` or `powershell.exe`. To run from those, you can use
```Cmd
REM Quoting required when run from cmd.exe
pwsh -CommandWithArgs "$args | % { ""arg: $_"" }" arg1 arg2
```

```powershell
# Quoting required when run from powershell.exe
pwsh -CommandWithArgs '"$args | % { ""arg: $_"" }"' arg1 arg2
```

### -ConfigurationName | -config

Specifies a configuration endpoint in which PowerShell is run. This can be any
Expand Down Expand Up @@ -410,3 +424,4 @@ prepend the command parameters with a hyphen (`-`), not a forward slash (`/`).
[02]: about_Automatic_Variables.md#lastexitcode
[03]: about_operators.md#special-operators
[04]: https://linux.die.net/man/1/chsh
[05]: about_Parsing.md#passing-arguments-that-contain-quote-characters

0 comments on commit ba86d1f

Please sign in to comment.