Skip to content

Commit e053a55

Browse files
Update about_pwsh (#10280)
* Update about_pwsh * Apply suggestions from review --------- Co-authored-by: Mikey Lombardi (He/Him) <[email protected]>
1 parent 73e13f9 commit e053a55

File tree

4 files changed

+71
-36
lines changed

4 files changed

+71
-36
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Explains how to use the `powershell.exe` command-line interface. Displays the command-line parameters and describes the syntax.
33
Locale: en-US
4-
ms.date: 05/08/2023
4+
ms.date: 07/17/2023
55
no-no-loc: [-Command, -ConfigurationName , -EncodedCommand, -ExecutionPolicy, -File, -Help, -InputFormat, -Mta, -NoExit, -NoLogo, -NonInteractive, -NoProfile, -OutputFormat, -PSConsoleFile, -Sta, -Version, -WindowStyle]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_powershell_exe?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
@@ -27,6 +27,7 @@ PowerShell[.exe]
2727
[-InputFormat {Text | XML}]
2828
[-OutputFormat {Text | XML}]
2929
[-WindowStyle <style>]
30+
[-EncodedArguments <Base64EncodedArguments>]
3031
[-EncodedCommand <Base64EncodedCommand>]
3132
[-ConfigurationName <string>]
3233
[-File - | <filePath> <args>]
@@ -124,6 +125,12 @@ Specifies a configuration endpoint in which PowerShell is run. This can be any
124125
endpoint registered on the local machine including the default PowerShell
125126
remoting endpoints or a custom endpoint having specific user role capabilities.
126127

128+
### -EncodedArguments \<Base64EncodedArguments\>
129+
130+
Accepts a Base64-encoded string version command arguments. Use this parameter
131+
to submit arguments that require complex, nested quoting. The Base64
132+
representation must be a UTF-16LE encoded string.
133+
127134
### -EncodedCommand \<Base64EncodedCommand\>
128135

129136
Accepts a base-64-encoded string version of a command. Use this parameter to

reference/7.2/Microsoft.PowerShell.Core/About/about_Pwsh.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Explains how to use the `pwsh` command-line interface. Displays the command-line parameters and describes the syntax.
33
Locale: en-US
4-
ms.date: 05/08/2023
4+
ms.date: 07/17/2023
55
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]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_pwsh?view=powershell-7.2&WT.mc_id=ps-gethelp
77
schema: 2.0.0
@@ -19,11 +19,13 @@ command-line parameters and describes the syntax.
1919

2020
```
2121
Usage: pwsh[.exe]
22+
[-Login]
2223
[[-File] <filePath> [args]]
2324
[-Command { - | <script-block> [-args <arg-array>]
24-
| <string> [<CommandParameters>] } ]
25+
| <string> [<CommandParameters>] } ]
2526
[-ConfigurationName <string>]
2627
[-CustomPipeName <string>]
28+
[-EncodedArguments <Base64EncodedArguments>]
2729
[-EncodedCommand <Base64EncodedCommand>]
2830
[-ExecutionPolicy <ExecutionPolicy>]
2931
[-InputFormat {Text | XML}]
@@ -35,7 +37,7 @@ Usage: pwsh[.exe]
3537
[-NonInteractive]
3638
[-NoProfile]
3739
[-OutputFormat {Text | XML}]
38-
[-SettingsFile <SettingsFilePath>]
40+
[-SettingsFile <filePath>]
3941
[-SSHServerMode]
4042
[-STA]
4143
[-Version]
@@ -218,6 +220,12 @@ pwsh -CustomPipeName mydebugpipe
218220
Enter-PSHostProcess -CustomPipeName mydebugpipe
219221
```
220222

223+
### -EncodedArguments | -encodeda | -ea
224+
225+
Accepts a Base64-encoded string version command arguments. Use this parameter
226+
to submit arguments that require complex, nested quoting. The Base64
227+
representation must be a UTF-16LE encoded string.
228+
221229
### -EncodedCommand | -e | -ec
222230

223231
Accepts a Base64-encoded string version of a command. Use this parameter to
@@ -239,9 +247,8 @@ Sets the default execution policy for the current session and saves it in the
239247
`$env:PSExecutionPolicyPreference` environment variable. This parameter does
240248
not change the persistently configured execution policies.
241249

242-
This parameter only applies to Windows computers. The
243-
`$env:PSExecutionPolicyPreference` environment variable doesn't exist on
244-
non-Windows platforms.
250+
This parameter only applies to Windows computers. On non-Windows platforms, the
251+
parameter and the value provided are ignored.
245252

246253
### -InputFormat | -inp | -if
247254

@@ -260,8 +267,8 @@ using /bin/sh to execute login profiles such as /etc/profile and ~/.profile.
260267
On Windows, this switch does nothing.
261268

262269
> [!IMPORTANT]
263-
> This parameter must come first to start PowerShell as a login shell.
264-
> Passing this parameter in another position will be ignored.
270+
> This parameter must come first to start PowerShell as a login shell. This
271+
> parameter is ignored if it is passed in another position.
265272
266273
To set up `pwsh` as the login shell on UNIX-like operating systems:
267274

@@ -286,7 +293,8 @@ To set up `pwsh` as the login shell on UNIX-like operating systems:
286293
### -MTA
287294

288295
Start PowerShell using a multi-threaded apartment. This switch is only
289-
available on Windows.
296+
available on Windows. Using this parameter on non-Windows platforms results in
297+
an error.
290298

291299
### -NoExit | -noe
292300

@@ -339,7 +347,8 @@ intended or supported for any other use.
339347
### -STA
340348

341349
Start PowerShell using a single-threaded apartment. This is the default. This
342-
switch is only available on the Windows platform.
350+
switch is only available on the Windows platform. Using this parameter on
351+
non-Windows platforms results in an error.
343352

344353
### -Version | -v
345354

@@ -348,9 +357,10 @@ Displays the version of PowerShell. Additional parameters are ignored.
348357
### -WindowStyle | -w
349358

350359
Sets the window style for the session. Valid values are Normal, Minimized,
351-
Maximized and Hidden.
360+
Maximized and Hidden. This parameter only applies to Windows. Using this
361+
parameter on non-Windows platforms results in an error.
352362

353-
### -WorkingDirectory | -wd
363+
### -WorkingDirectory | -wd | -wo
354364

355365
Sets the initial working directory by executing at startup. Any valid
356366
PowerShell file path is supported.

reference/7.3/Microsoft.PowerShell.Core/About/about_Pwsh.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Explains how to use the `pwsh` command-line interface. Displays the command-line parameters and describes the syntax.
33
Locale: en-US
4-
ms.date: 05/08/2023
4+
ms.date: 07/17/2023
55
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]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_pwsh?view=powershell-7.3&WT.mc_id=ps-gethelp
77
schema: 2.0.0
@@ -26,6 +26,7 @@ Usage: pwsh[.exe]
2626
[-ConfigurationFile <filePath>]
2727
[-ConfigurationName <string>]
2828
[-CustomPipeName <string>]
29+
[-EncodedArguments <Base64EncodedArguments>]
2930
[-EncodedCommand <Base64EncodedCommand>]
3031
[-ExecutionPolicy <ExecutionPolicy>]
3132
[-InputFormat {Text | XML}]
@@ -227,6 +228,12 @@ pwsh -CustomPipeName mydebugpipe
227228
Enter-PSHostProcess -CustomPipeName mydebugpipe
228229
```
229230

231+
### -EncodedArguments | -encodeda | -ea
232+
233+
Accepts a Base64-encoded string version command arguments. Use this parameter
234+
to submit arguments that require complex, nested quoting. The Base64
235+
representation must be a UTF-16LE encoded string.
236+
230237
### -EncodedCommand | -e | -ec
231238

232239
Accepts a Base64-encoded string version of a command. Use this parameter to
@@ -248,9 +255,8 @@ Sets the default execution policy for the current session and saves it in the
248255
`$env:PSExecutionPolicyPreference` environment variable. This parameter does
249256
not change the persistently configured execution policies.
250257

251-
This parameter only applies to Windows computers. The
252-
`$env:PSExecutionPolicyPreference` environment variable doesn't exist on
253-
non-Windows platforms.
258+
This parameter only applies to Windows computers. On non-Windows platforms, the
259+
parameter and the value provided are ignored.
254260

255261
### -InputFormat | -inp | -if
256262

@@ -269,8 +275,8 @@ using /bin/sh to execute login profiles such as /etc/profile and ~/.profile.
269275
On Windows, this switch does nothing.
270276

271277
> [!IMPORTANT]
272-
> This parameter must come first to start PowerShell as a login shell.
273-
> Passing this parameter in another position will be ignored.
278+
> This parameter must come first to start PowerShell as a login shell. This
279+
> parameter is ignored if it is passed in another position.
274280
275281
To set up `pwsh` as the login shell on UNIX-like operating systems:
276282

@@ -295,7 +301,8 @@ To set up `pwsh` as the login shell on UNIX-like operating systems:
295301
### -MTA
296302

297303
Start PowerShell using a multi-threaded apartment. This switch is only
298-
available on Windows.
304+
available on Windows. Using this parameter on non-Windows platforms results in
305+
an error.
299306

300307
### -NoExit | -noe
301308

@@ -353,7 +360,8 @@ intended or supported for any other use.
353360
### -STA
354361

355362
Start PowerShell using a single-threaded apartment. This is the default. This
356-
switch is only available on the Windows platform.
363+
switch is only available on the Windows platform. Using this parameter on
364+
non-Windows platforms results in an error.
357365

358366
### -Version | -v
359367

@@ -362,9 +370,10 @@ Displays the version of PowerShell. Additional parameters are ignored.
362370
### -WindowStyle | -w
363371

364372
Sets the window style for the session. Valid values are Normal, Minimized,
365-
Maximized and Hidden.
373+
Maximized and Hidden. This parameter only applies to Windows. Using this
374+
parameter on non-Windows platforms results in an error.
366375

367-
### -WorkingDirectory | -wd
376+
### -WorkingDirectory | -wd | -wo
368377

369378
Sets the initial working directory by executing at startup. Any valid
370379
PowerShell file path is supported.

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

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Explains how to use the `pwsh` command-line interface. Displays the command-line parameters and describes the syntax.
33
Locale: en-US
4-
ms.date: 05/08/2023
4+
ms.date: 07/17/2023
55
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]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_pwsh?view=powershell-7.4&WT.mc_id=ps-gethelp
77
schema: 2.0.0
@@ -23,10 +23,11 @@ Usage: pwsh[.exe]
2323
[[-File] <filePath> [args]]
2424
[-Command { - | <script-block> [-args <arg-array>]
2525
| <string> [<CommandParameters>] } ]
26-
[-CommandWithArgs <string>] [<CommandParameters>]
26+
[[-CommandWithArgs <string>] [<CommandParameters>]]
2727
[-ConfigurationFile <filePath>]
2828
[-ConfigurationName <string>]
2929
[-CustomPipeName <string>]
30+
[-EncodedArguments <Base64EncodedArguments>]
3031
[-EncodedCommand <Base64EncodedCommand>]
3132
[-ExecutionPolicy <ExecutionPolicy>]
3233
[-InputFormat {Text | XML}]
@@ -200,9 +201,9 @@ or when execution is interrupted with <kbd>Ctrl</kbd>+<kbd>C</kbd>.
200201
This is an experimental feature added in 7.4.0-preview.2.
201202

202203
Executes a PowerShell command with arguments. Unlike `-Command`, this parameter
203-
populates the `$args` built-in variable which can be used by the command.
204+
populates the `$args` built-in variable that can be used by the command.
204205

205-
The first string is the command and subsequent strings delimited by whitespace
206+
The first string is the command. Additional strings delimited by whitespace
206207
are the arguments.
207208

208209
For example:
@@ -251,6 +252,12 @@ pwsh -CustomPipeName mydebugpipe
251252
Enter-PSHostProcess -CustomPipeName mydebugpipe
252253
```
253254

255+
### -EncodedArguments | -encodeda | -ea
256+
257+
Accepts a Base64-encoded string version command arguments. Use this parameter
258+
to submit arguments that require complex, nested quoting. The Base64
259+
representation must be a UTF-16LE encoded string.
260+
254261
### -EncodedCommand | -e | -ec
255262

256263
Accepts a Base64-encoded string version of a command. Use this parameter to
@@ -272,9 +279,8 @@ Sets the default execution policy for the current session and saves it in the
272279
`$env:PSExecutionPolicyPreference` environment variable. This parameter does
273280
not change the persistently configured execution policies.
274281

275-
This parameter only applies to Windows computers. The
276-
`$env:PSExecutionPolicyPreference` environment variable doesn't exist on
277-
non-Windows platforms.
282+
This parameter only applies to Windows computers. On non-Windows platforms, the
283+
parameter and the value provided are ignored.
278284

279285
### -InputFormat | -inp | -if
280286

@@ -293,8 +299,8 @@ using /bin/sh to execute login profiles such as /etc/profile and ~/.profile.
293299
On Windows, this switch does nothing.
294300

295301
> [!IMPORTANT]
296-
> This parameter must come first to start PowerShell as a login shell.
297-
> Passing this parameter in another position will be ignored.
302+
> This parameter must come first to start PowerShell as a login shell. This
303+
> parameter is ignored if it is passed in another position.
298304
299305
To set up `pwsh` as the login shell on UNIX-like operating systems:
300306

@@ -319,7 +325,8 @@ To set up `pwsh` as the login shell on UNIX-like operating systems:
319325
### -MTA
320326

321327
Start PowerShell using a multi-threaded apartment. This switch is only
322-
available on Windows.
328+
available on Windows. Using this parameter on non-Windows platforms results in
329+
an error.
323330

324331
### -NoExit | -noe
325332

@@ -377,7 +384,8 @@ intended or supported for any other use.
377384
### -STA
378385

379386
Start PowerShell using a single-threaded apartment. This is the default. This
380-
switch is only available on the Windows platform.
387+
switch is only available on the Windows platform. Using this parameter on
388+
non-Windows platforms results in an error.
381389

382390
### -Version | -v
383391

@@ -386,9 +394,10 @@ Displays the version of PowerShell. Additional parameters are ignored.
386394
### -WindowStyle | -w
387395

388396
Sets the window style for the session. Valid values are Normal, Minimized,
389-
Maximized and Hidden.
397+
Maximized and Hidden. This parameter only applies to Windows. Using this
398+
parameter on non-Windows platforms results in an error.
390399

391-
### -WorkingDirectory | -wd
400+
### -WorkingDirectory | -wd | -wo
392401

393402
Sets the initial working directory by executing at startup. Any valid
394403
PowerShell file path is supported.

0 commit comments

Comments
 (0)