PowerShell: inspect PSReadLine colours
Show PSReadLine colour options and the PowerShell version.
In PowerShell, command-line colours (keywords, strings, comments...) are handled by the PSReadLine module. These commands let you inspect them.
# Show only the colour options
Get-PSReadlineOption | Select-Object *color
# Show all PSReadLine options
Get-PSReadlineOption
# Get the PowerShell version
$PSVersionTable.PSVersion
Notes
- On PowerShell 6, a PSReadLine error may appear at startup: see this troubleshooting article.
- To change a colour, use
Set-PSReadLineOption(for example-Colors @{ Comment = 'DarkGray' }on recent module versions).