@@ -6,23 +6,22 @@ keywords: powershell,cmdlet
66title : about_PowerShell_exe
77---
88
9- # About PowerShell.exe
10- ## about_PowerShell.exe
9+ # About pwsh
10+ ## about_pwsh
1111
1212
1313# SHORT DESCRIPTION
1414
15- Explains how to use the PowerShell.exe command-line tool. Displays
15+ Explains how to use the pwsh command-line tool. Displays
1616the syntax and describes the command-line switches.
1717
18- PowerShell.exe starts a Windows PowerShell session. You can use it
19- in Cmd.exe and in Windows PowerShell.
18+ pwsh starts a PowerShell session.
2019
2120# LONG DESCRIPTION
2221
2322# SYNTAX
2423
25- PowerShell [ .exe]
24+ pwsh [ .exe]
2625[ -Version]
2726[ -EncodedCommand <Base64EncodedCommand >]
2827[ -ExecutionPolicy <ExecutionPolicy >]
@@ -36,7 +35,7 @@ PowerShell[.exe]
3635[ -File <FilePath > [ <Args >]]
3736[ -Command { - | <script-block > [ -args <arg-array >]
3837| <string > [ <CommandParameters >] } ]
39- PowerShell [ .exe] -Help | -? | /?
38+ pwsh [ .exe] -Help | -? | /?
4039
4140# PARAMETERS
4241
@@ -46,17 +45,14 @@ are ignored.
4645
4746-EncodedCommand <Base64EncodedCommand >
4847Accepts a base-64-encoded string version of a command.
49- Use this parameter to submit commands to Windows PowerShell
48+ Use this parameter to submit commands to PowerShell
5049that require complex quotation marks or curly braces.
5150
5251-ExecutionPolicy <ExecutionPolicy >
5352Sets the default execution policy for the current session
5453and saves it in the $env: PSExecutionPolicyPreference environment
55- variable. This parameter does not change the Windows PowerShell
56- execution policy that is set in the registry. For information
57- about Windows PowerShell execution policies, including a list
58- of valid values, see about_Execution_Policies
59- (http://go.microsoft.com/fwlink/?LinkID=135170 ).
54+ variable. This parameter does not change the PowerShell
55+ execution policy that is set in the registry.
6056
6157-File <FilePath > [ <Parameters >]
6258Runs the specified script in the local scope ("dot-sourced"),
@@ -84,7 +80,7 @@ such as the following:
8480-File .\Get-Script.ps1 {-All:$False}.
8581
8682-InputFormat {Text | XML}
87- Describes the format of data sent to Windows PowerShell. Valid
83+ Describes the format of data sent to PowerShell. Valid
8884values are "Text" (text strings) or "XML" (serialized CLIXML format).
8985
9086-NoExit
@@ -97,10 +93,10 @@ Hides the copyright banner at startup.
9793Does not present an interactive prompt to the user.
9894
9995-NoProfile
100- Does not load the Windows PowerShell profile.
96+ Does not load the PowerShell profile.
10197
10298-OutputFormat {Text | XML}
103- Determines how output from Windows PowerShell is formatted.
99+ Determines how output from PowerShell is formatted.
104100Valid values are "Text" (text strings) or "XML" (serialized
105101CLIXML format).
106102
@@ -110,44 +106,39 @@ Minimized, Maximized and Hidden.
110106
111107-Command
112108Executes the specified commands (and any parameters) as though
113- they were typed at the Windows PowerShell command prompt, and
109+ they were typed at the PowerShell command prompt, and
114110then exits, unless the NoExit parameter is specified.
115111
116112The value of Command can be "-", a string. or a script block. If
117113the value of Command is "-", the command text is read from standard
118114input.
119115
120116Script blocks must be enclosed in braces ({}). You can specify a
121- script block only when running PowerShell.exe in Windows PowerShell.
117+ script block only when running pwsh in PowerShell.
122118The results of the script are returned to the parent shell as
123119deserialized XML objects, not live objects.
124120
125121If the value of Command is a string, Command must be the last
126122parameter in the command , because any characters typed after
127123the command are interpreted as the command arguments.
128124
129- To write a string that runs a Windows PowerShell command, use the
125+ To write a string that runs a PowerShell command, use the
130126format:
131127"& {<command >}"
132128where the quotation marks indicate a string and the invoke operator
133129(&) causes the command to be executed.
134130
135131-Help, -?, /?
136- Displays help for PowerShell.exe. If you are typing a PowerShell.exe
137- command in Windows PowerShell, prepend the command parameters with a
132+ Displays help for pwsh. If you are typing a pwsh
133+ command in PowerShell, prepend the command parameters with a
138134hyphen (-), not a forward slash (/). You can use either a hyphen or
139135forward slash in Cmd.exe.
140136
141- # REMARKS:
142-
143- Troubleshooting note: In Windows PowerShell 2.0, starting some programs
144- from the Windows PowerShell console fails with a LastExitCode of 0xc0000142.
145-
146137# EXAMPLES
147138
148- PowerShell -Version
139+ pwsh -Version
149140
150- PowerShell -Command {Get-EventLog -LogName security }
141+ pwsh -Command {Get-Command -Name Get-Command }
151142
152- PowerShell -Command "& {Get-EventLog -LogName security }"
143+ pwsh -Command "& {Get-Command -Name Get-Command }"
153144
0 commit comments