Enable-ConsoleFormatting
Enables the everyday console views, native format commands and theme colours.
Syntax
Enable-ConsoleFormatting
[-ErrorLayout <Compact| Standard| Detailed>]
[-Exclude <ConsoleFormattingFeature[]>]
[-Force]
[-Include <ConsoleFormattingFeature[]>]
[-NoBuiltIn]
[-ProfileSnippet]
[-Save]
[<CommonParameters>]#DefaultDescription
Three ways to use ConsoleMonster output: Automatic: enable formatting, then use ordinary commands for known and registered types. Explicit: pipe any objects to Show-ConsoleTable to choose columns, a title and grouping, or to Show-ConsoleObject to explore their members. These commands do not change session formatting; Show-ConsoleObject -Mode Snapshot avoids interactive input in scripts. Native Format commands: FormatCommands styles direct console output while keeping PowerShell's column choices; it is included by default; use -Exclude FormatCommands to leave it native. You do not need both automatic and explicit formatting.
By default, Output, FormatCommands, Errors, Streams and ReadLine are enabled. Format-Table, Format-List and Format-Wide keep PowerShell's column choices and change only direct console output; pipelines, captures, files, jobs, remoting and transcripts remain native. Use Include to add opt-in features and Exclude to remove features from the default set. Prompt, Help, Progress and GridView require Include. ErrorLayout Compact opts into the compact error layout. Get-ConsoleFormatting reports what is enabled. Disable-ConsoleFormatting restores the session. In supported CI providers, the Errors feature also annotates displayed errors with a script position, including terminating errors; each output pipeline emits at most ten annotations and one overflow count.
Files, processes, services, structured records, commands, modules, history, IP addresses, volumes, versions, dictionaries and registered types get built-in or registered views. Explicit Show-Console commands remain available when you want to choose the view yourself. Custom Out-Default functions are kept unless Force is specified; Prompt does not replace oh-my-posh or Starship without Force.
Examples
Example 1
Enable-ConsoleFormatting; 'synthetic' | Get-Member -Name Length, Substring; Get-Command Get-Date | Format-Table Name, SourceInspect members with the built-in view, while keeping an explicit native column selection
Example 2
$formattingOptions = @{
Include = @('GridView')
}
Enable-ConsoleFormatting @formattingOptions; Get-Process | Out-GridView -Title 'Choose processes' -OutputMode SingleUse the terminal grid where Out-GridView is unavailable; working native commands stay unchanged
Example 3
Enable-ConsoleFormatting; Get-ChildItem; Get-Process | Select-Object -First 10Turn it on for the session
Example 4
Set-ConsoleTheme -Theme Dark;
$formattingOptions = @{
Include = @('Prompt')
}
Enable-ConsoleFormatting @formattingOptionsAdd a minimal themed shell prompt to the default formatting
Example 5
$themeOptions = @{
Theme = 'ColorBlindSafe'
}
Set-ConsoleTheme @themeOptions; Enable-ConsoleFormatting -ProfileSnippetThe lines to keep it on in every session with a colour-blind-safe theme (printed, never written to the profile)
Example 6
$formattingOptions = @{
Save = $true
Include = @('Help', 'Progress')
}
Enable-ConsoleFormatting @formattingOptionsKeep these features for every session: afterwards the profile needs only Enable-ConsoleFormatting
Example 7
$formattingOptions = @{
Exclude = @('FormatCommands')
}
Enable-ConsoleFormatting @formattingOptionsExclude native format command styling from the default set
Example 8
$themeOptions = @{
Theme = 'Light'
}
Set-ConsoleTheme @themeOptions;
$formattingOptions = @{
Include = @('Streams')
}
Enable-ConsoleFormatting @formattingOptions; Write-Warning 'Disk space is low'; Write-Verbose 'Checking backup' -VerboseUse the active theme for native stream messages, keeping PowerShell's prefixes and stream behaviour
Example 9
$themeOptions = @{
Theme = 'Dark'
}
Set-ConsoleTheme @themeOptions;
$formattingOptions = @{
Include = @('ReadLine', 'Streams')
}
Enable-ConsoleFormatting @formattingOptions; Write-Progress -Activity 'Backup' -Status 'Copying archive.zip' -PercentComplete 42; Write-Progress -Activity 'Backup' -CompletedTheme the already loaded editor and native progress without replacing commands
Parameters
- -ErrorLayout String
- Error detail: Compact, Standard or Detailed. Errors must be enabled.
- Possible values:
Compact,Standard,Detailed - -Exclude ConsoleFormattingFeature[]
- Turns on the default set except these features, and disables any excluded feature already enabled. Cannot be combined with Feature.
- Possible values:
Output,Errors,Progress,FormatCommands,Streams,Help,ReadLine,GridView,Prompt - -Force SwitchParameter
- Replaces an existing Out-Default function, Write-Progress alias, or an Out-GridView function/alias when the native grid is unavailable (Disable-ConsoleFormatting puts it back). A working native Out-GridView is always kept. Prompt requires Force to replace oh-my-posh or Starship.
- -Include ConsoleFormattingFeature[]
- Adds these opt-in features to the default set. Can be combined with Exclude, but not Feature.
- Possible values:
Output,Errors,Progress,FormatCommands,Streams,Help,ReadLine,GridView,Prompt - -NoBuiltIn SwitchParameter
- Only takes over the types registered with Register-ConsoleView, not the built-in ones (files, processes, services, dictionaries, Compare-Object results). The built-in views still pick the columns of Show-ConsoleTable and the other commands.
- -ProfileSnippet SwitchParameter
- Prints the lines to add to your PowerShell profile so every session starts with ConsoleMonster's formatting, with the options you passed, and changes nothing: the profile is never edited and formatting is not enabled. Pipe them to Add-Content $PROFILE yourself if you want them.
- -Save SwitchParameter
- Also writes the feature, error layout, and built-in view choices to the settings file. Later, Enable-ConsoleFormatting without any of them uses the saved choices. Enable-ConsoleFormatting -Save without them saves the default set.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.