共用方式為


Get-PSReadLineOption

取得可設定之選項的值。

Syntax

Get-PSReadLineOption []

Description

Cmdlet 會 Get-PSReadLineOptionSet-PSReadLineOption 回可使用 Cmdlet 設定的目前狀態。 您可以使用傳回的物件來變更 PSReadLine 選項。 這提供稍微簡單的方式來設定多種標記的語法著色選項。

範例

範例 1:取得選項及其值

Get-PSReadLineOption

EditMode                               : Windows
ContinuationPrompt                     : >>
ContinuationPromptForegroundColor      : DarkYellow
ContinuationPromptBackgroundColor      : DarkMagenta
ExtraPromptLineCount                   : 0
AddToHistoryHandler                    :
CommandValidationHandler               :
CommandsToValidateScriptBlockArguments : {ForEach-Object, %, Invoke-Command, icm...}
HistoryNoDuplicates                    : False
MaximumHistoryCount                    : 4096
MaximumKillRingCount                   : 10
HistorySearchCursorMovesToEnd          : False
ShowToolTips                           : False
DingTone                               : 1221
CompletionQueryItems                   : 100
WordDelimiters                         : ;:,.[]{}()/\|^&*-=+'"
DingDuration                           : 50
BellStyle                              : Audible
HistorySearchCaseSensitive             : False
ViModeIndicator                        : None
HistorySavePath                        : C:\Users\testuser\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\Cons
                                         oleHost_history.txt
HistorySaveStyle                       : SaveIncrementally
DefaultTokenForegroundColor            : DarkYellow
CommentForegroundColor                 : DarkGreen
KeywordForegroundColor                 : Green
StringForegroundColor                  : DarkCyan
OperatorForegroundColor                : DarkGray
VariableForegroundColor                : Green
CommandForegroundColor                 : Yellow
ParameterForegroundColor               : DarkGray
TypeForegroundColor                    : Gray
NumberForegroundColor                  : White
MemberForegroundColor                  : White
DefaultTokenBackgroundColor            : DarkMagenta
CommentBackgroundColor                 : DarkMagenta
KeywordBackgroundColor                 : DarkMagenta
StringBackgroundColor                  : DarkMagenta
OperatorBackgroundColor                : DarkMagenta
VariableBackgroundColor                : DarkMagenta
CommandBackgroundColor                 : DarkMagenta
ParameterBackgroundColor               : DarkMagenta
TypeBackgroundColor                    : DarkMagenta
NumberBackgroundColor                  : DarkMagenta
MemberBackgroundColor                  : DarkMagenta
EmphasisForegroundColor                : Cyan
EmphasisBackgroundColor                : DarkMagenta
ErrorForegroundColor                   : Red
ErrorBackgroundColor                   : DarkMagenta

此命令會傳回可用的 PSReadLine 選項清單及其目前的值。

輸入

None

您無法使用管線將物件傳送至此 Cmdlet。

輸出

PSConsoleReadLineOptions