Skip to content

Make prompt colors configurable #10339

Open
@dkaszews

Description

@dkaszews

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."

Summary

PowerShell/PowerShell#18003 introduces new properties to $PSStyle that control how -Confirm prompt is rendered:

$PSStyle.Prompt.Caption
$PSStyle.Prompt.Message
$PSStyle.Prompt.Help
$PSStyle.Prompt.ChoiceDefault
$PSStyle.Prompt.ChoiceOther
$PSStyle.Prompt.ChoiceHelp

Details

The documentation should explain which property controls which part of the confirm prompt. In the example below:

$PSStyle.Prompt.Caption = $PSStyle.Background.Red  # First line
$PSStyle.Prompt.Message = $PSStyle.Foreground.BrightBlack  # Other lines
$PSStyle.Prompt.Help = $PSStyle.Foreground.Purple  # "default is"
$PSStyle.Prompt.ChoiceDefault = $PSStyle.Foreground.Purple  # First choice
$PSStyle.Prompt.ChoiceOther = $PSStyle.Foreground.Blue  # Other choices
$PSStyle.Prompt.ChoiceHelp = $PSStyle.Foreground.Green  # Choice "[?] Help"

image

An image with rectangles and arrows deliminating each section may be clearer than trying to match colors.

Articles

  • reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md, section -Confirm

Related Source Pull Requests

Related Source Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions