diff --git a/src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx b/src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx index a40c9d4b1ce..81021421024 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx +++ b/src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx @@ -122,111 +122,119 @@ Copyright (C) Microsoft Corporation. All rights reserved. - PowerShell[.exe] [-Version] [-NoLogo] [-NoExit] - [-NoProfile] [-NonInteractive] [-Interactive] - [-InputFormat {Text | XML}] [-OutputFormat {Text | XML}] - [-WindowStyle <style>] [-EncodedCommand <Base64EncodedCommand>] - [-ConfigurationName <string>] - [-Command { - | <script-block> [-args <arg-array>] - | <string> [<CommandParameters>] } ] - [-File <filePath> <args>] [-ExecutionPolicy <ExecutionPolicy>] - -PowerShell[.exe] -Help | -? | /? - --Version - Shows the version of PowerShell and exits. - Additional arguments are ignored. - --NoLogo - Hides the copyright banner at startup. + Usage: powershell[.exe] [[-File] <filePath> [args]] + [-Command { - | <script-block> [-args <arg-array>] + | <string> [<CommandParameters>] } ] + [-ConfigurationName <string>] [-EncodedCommand <Base64EncodedCommand>] + [-ExecutionPolicy <ExecutionPolicy>] [-InputFormat {Text | XML}] + [-Interactive] [-NoExit] [-NoLogo] [-NonInteractive] [-NoProfile] + [-OutputFormat {Text | XML}] [-Version] [-WindowStyle <style>] --NoExit - Does not exit after running startup commands. + powershell[.exe] -h | -Help | -? | /? --NoProfile - Does not load the PowerShell profile. +PowerShell Online Help https://aka.ms/pscore6-docs --NonInteractive - Does not present an interactive prompt to the user. +All parameters are case-insensitive. --Interactive - Present an interactive prompt to the user. +-Command | -c + Executes the specified commands (and any parameters) as though they were typed + at the PowerShell command prompt, and then exits, unless NoExit is specified. + The value of Command can be "-", a string. or a script block. --InputFormat - Describes the format of data sent to PowerShell. Valid values are - "Text" (text strings) or "XML" (serialized CLIXML format). + If the value of Command is "-", the command text is read from standard input. --OutputFormat - Determines how output from PowerShell is formatted. Valid values - are "Text" (text strings) or "XML" (serialized CLIXML format). + If the value of Command is a script block, the script block must be enclosed + in braces ({}). You can specify a script block only when running 'powershell' + in PowerShell. The results of the script block are returned to the + parent shell as deserialized XML objects, not live objects. --WindowStyle - Sets the window style to Normal, Minimized, Maximized or Hidden. + If the value of Command is a string, Command must be the last parameter in the command, + because any characters typed after the command are interpreted as the command arguments. --EncodedCommand - Accepts a base-64-encoded string version of a command. Use this parameter - to submit commands to PowerShell that require complex quotation - marks or curly braces. + To write a string that runs a PowerShell command, use the format: + "& {<command>}" + where the quotation marks indicate a string and the invoke operator (&) + causes the command to be executed. + + Example: + powershell -Command {Get-WinEvent -LogName security} + powershell -command "& {Get-WinEvent -LogName security}" --ConfigurationName +-ConfigurationName | -config Specifies a configuration endpoint in which PowerShell is run. - This can be any endpoint registered on the local machine including the - default PowerShell remoting endpoints or a custom endpoint having - specific user role capabilities. - --File - Runs the specified script in the local scope ("dot-sourced"), so that the - functions and variables that the script creates are available in the - current session. Enter the script file path and any parameters. - File must be the last parameter in the command, because all characters - typed after the File parameter name are interpreted - as the script file path followed by the script parameters. + This can be any endpoint registered on the local machine including the default PowerShell + remoting endpoints or a custom endpoint having specific user role capabilities. + + Example: powershell -configurationmame AdminRoles --ExecutionPolicy +-EncodedCommand | -e | -ec + Accepts a base64 encoded string version of a command. Use this parameter to submit + commands to PowerShell that require complex quotation marks or curly braces. + + Example: + $command = 'dir "c:\program files" ' + $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) + $encodedCommand = [Convert]::ToBase64String($bytes) + powershell -encodedcommand $encodedCommand + +-ExecutionPolicy | -ex | -ep Sets the default execution policy for the current session and saves it in the $env:PSExecutionPolicyPreference environment variable. This parameter does not change the PowerShell execution policy that is set in the registry. --Command - Executes the specified commands (and any parameters) as though they were - typed at the PowerShell command prompt, and then exits, unless - NoExit is specified. The value of Command can be "-", a string. or a - script block. + Example: powershell -ExecutionPolicy RemoteSigned - If the value of Command is "-", the command text is read from standard - input. +-File | -f + Default parameter if no parameters is present but any values is present in the command line. + Runs the specified script in the local scope ("dot-sourced"), so that the functions + and variables that the script creates are available in the current session. + Enter the script file path and any parameters. File must be the last parameter + in the command, because all characters typed after the File parameter name are interpreted + as the script file path followed by the script parameters. - If the value of Command is a script block, the script block must be enclosed - in braces ({}). You can specify a script block only when running PowerShell.exe - in PowerShell. The results of the script block are returned to the - parent shell as deserialized XML objects, not live objects. + Example: powershell HelloWorld.ps1 - If the value of Command is a string, Command must be the last parameter - in the command , because any characters typed after the command are - interpreted as the command arguments. +-Help | -h | -? | /? + Shows this message. If you are typing a 'powershell' command in PowerShell on Windows + system, prepend the command parameters with a hyphen (-), not a forward slash (/). + You can use either a hyphen or forward slash in Cmd.exe. - To write a string that runs a PowerShell command, use the format: - "& {<command>}" - where the quotation marks indicate a string and the invoke operator (&) - causes the command to be executed. +-InputFormat | -in | -if + Describes the format of data sent to PowerShell. + Valid values are "Text" (text strings) or "XML" (serialized CLIXML format). --Help, -?, /? - Shows this message. If you are typing a PowerShell.exe command in Windows - PowerShell, prepend the command parameters with a hyphen (-), not a forward - slash (/). You can use either a hyphen or forward slash in Cmd.exe. - -EXAMPLES - PowerShell -Version - PowerShell -ConfigurationName AdminRoles - PowerShell -Command {Get-EventLog -LogName security} - PowerShell -Command "& {Get-EventLog -LogName security}" - PowerShell HelloWorld.ps1 - - # To use the -EncodedCommand parameter: - $command = 'dir "c:\program files" ' - $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) - $encodedCommand = [Convert]::ToBase64String($bytes) - powershell -encodedCommand $encodedCommand +-Interactive | -i + Present an interactive prompt to the user. Inverse for NonInteractive parameter. + +-NoExit | -noe + Does not exit after running startup commands. + + Example: powershell.exe -NoExit -Command Get-Date + +-NoLogo | -nol + Hides the copyright banner at startup. + +-NonInteractive | -noni + Does not present an interactive prompt to the user. Inverse for Interactive parameter. + +-NoProfile | -nop + Does not load the PowerShell profiles. + +-OutputFormat | -o | -of + Determines how output from PowerShell is formatted. Valid values + are "Text" (text strings) or "XML" (serialized CLIXML format). + Default is "Text". + + Example: powershell -o XML -c Get-Date + +-Version | -v + Shows the version of PowerShell and exits. Additional arguments are ignored. + + Example: powershell -v + +-WindowStyle | -w + Sets the window style to Normal, Minimized, Maximized or Hidden. +