Skip to content
ConsoleMonster
Cmdlet

Import-ConsolePrompt

Module
ConsoleMonster
Outputs
System.Management.Automation.PSObject

Reads an oh-my-posh JSON theme and writes it as a ConsoleMonster prompt theme file.

Syntax

Import-ConsolePrompt
[-OutFile <String>]
[-Path] <String>
[-Title <String>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Segments with a ConsoleMonster equivalent keep their side, order and colours, along with the options that map: path style, Git counts and stash, the duration threshold and the time format. A trailing line holding only literal text becomes the input marker, and tooltips become command hints. The result lists in Notes everything that was left out or approximated, such as segment text templates and segments without an equivalent. The command does not change the session; use Show-ConsolePrompt -Path to preview the result and Set-ConsolePrompt -Path to use it.

Examples

Example 1

# Requires an oh-my-posh JSON theme file.
$result = Import-ConsolePrompt -Path ./mytheme.omp.json
$result.Notes
Show-ConsolePrompt -Path $result.Path

Read an oh-my-posh theme, check what changed and preview it

Parameters

-OutFile String optional
The destination prompt theme. Defaults to the source directory and base name with .prompt.json, dropping a trailing .omp: mytheme.omp.json becomes mytheme.prompt.json. The source file cannot be overwritten.
-Path String requiredposition: 0
A literal oh-my-posh .json theme file. YAML and TOML themes are not read.
-Title String optional
The theme name stored in the file. Defaults to the source file name.

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.