< Back

New-MSTerminalProfile

Sat Jan 18, 2020 4:51 pm

NAME New-MSTerminalProfile



SYNOPSIS

Creates a new MS Terminal profile.





SYNTAX

New-MSTerminalProfile [-Name] <String> [-CommandLine] <String> [[-FontSize] <Int32>] [[-Background] <String>]

[[-Foreground] <String>] [[-AcrylicOpacity] <Single>] [[-BackgroundImage] <String>] [[-BackgroundImageAlignment]

{center | left | top | right | bottom | topLeft | topRight | bottomLeft | bottomRight}] [[-BackgroundImageOpacity]

<Double>] [[-BackgroundImageStretchMode] {none | fill | uniform | uniformToFill}] [[-ScrollbarState] {visible |

hidden}] [[-TabTitle] <String>] [[-HistorySize] <Int32>] [[-Icon] <String>] [[-Padding] <Int32[]>]

[[-ExtraSettings] <Hashtable>] [[-ColorScheme] <String>] [[-ColorTable] <String[]>] [[-CursorColor] <String>]

[[-CursorShape] {bar | emptyBox | filledBox | underscore | vintage}] [[-CursorHeight] <Int32>] [[-FontFace]

<String>] [[-StartingDirectory] <String>] [-CloseOnExit] [-Confirm] [-MakeDefault] [-SnapOnInput] [-UseAcrylic]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

Creates a new MS Terminal profile.





PARAMETERS

-AcrylicOpacity <Single>

Sets the acrylic opacity, 0 being completely transparent and 1 being completely opaque. This should be a

number between 0 and 1.



Required? false

Position? 13

Default value 0.5

Accept pipeline input? False

Accept wildcard characters? false



-Background <String>

Sets the background color of the profile. Overrides "background" set in color scheme if "colorScheme" is set.



Required? false

Position? 11

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-BackgroundImage <String>

The path to an image to use as the background for the terminal window. This value is ignored if UseAcrylic is

enabled.



Ex: "file:///c:/users/USER/Pictures/background.jpg"



Required? false

Position? 14

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-BackgroundImageAlignment <String>

Sets how the background image aligns to the boundaries of the window.



Required? false

Position? 15

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-BackgroundImageOpacity <Double>

The background image opacity, a number between 0 and 1.



Required? false

Position? 16

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-BackgroundImageStretchMode <String>

How to resize the background image.



Fill - The background is resized to fill the window. The aspect ratio is not preserved. None - The background

image is kept at it's original dimensions. Uniform - The background image is resized to fill the window,

preserving the aspect ratio. UniformToFill - The background image is resized to fill the window, clipping the

image to make it fit the window and preserving the aspect ratio.



Required? false

Position? 17

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CloseOnExit [<SwitchParameter>]

Should MS Terminal close the tab when the program exits.



Required? false

Position? named

Default value True

Accept pipeline input? False

Accept wildcard characters? false



-ColorScheme <String>

The name of the color scheme to use for this profile.



Required? false

Position? 3

Default value Campbell

Accept pipeline input? False

Accept wildcard characters? false



-ColorTable <String[]>

Array of colors used in the profile if colorscheme is not set. Colors use hex color format: "#rrggbb".

Ordering is as follows: [black, red, green, yellow, blue, magenta, cyan, white, bright black, bright red,

bright green, bright yellow, bright blue, bright magenta, bright cyan, bright white]



Required? false

Position? 4

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CommandLine <String>

The command line to run for this profile.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-CursorColor <String>

The cursor color in the format "#RRGGBB"



Required? false

Position? 5

Default value #ffffff

Accept pipeline input? False

Accept wildcard characters? false



-CursorHeight <Int32>

Sets the height of the cursor. Only works when "cursorShape" is set to "vintage". Accepts values from 25-100.



Required? false

Position? 7

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CursorShape <String>

The cursor shape.



Required? false

Position? 6

Default value Bar

Accept pipeline input? False

Accept wildcard characters? false



-ExtraSettings <Hashtable>

A hashtable of additional settings to set in the profile. These entries are not validated and override other

parameter settings, use at your own risk!



Required? false

Position? 22

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-FontFace <String>

The name of the font to use for this profile.



Required? false

Position? 8

Default value Consolas

Accept pipeline input? False

Accept wildcard characters? false



-FontSize <Int32>

The size of the font



Required? false

Position? 10

Default value 12

Accept pipeline input? False

Accept wildcard characters? false



-Foreground <String>

Sets the foreground color of the profile. Overrides foreground set in color scheme if colorscheme is set. Uses

hex color format: "#rrggbb".



Required? false

Position? 12

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HistorySize <Int32>

The number of lines of history to store.



Required? false

Position? 2

Default value 9001

Accept pipeline input? False

Accept wildcard characters? false



-Icon <String>

The icon to use for this profile. Ex: "ms-appdata:///roaming/console.ico"



Required? false

Position? 20

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MakeDefault [<SwitchParameter>]

If specified, this profile will become the default profile.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

The name of the profile.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Padding <Int32[]>

The padding to use between the window edges and the text.



Required? false

Position? 21

Default value 0,0,0,0

Accept pipeline input? False

Accept wildcard characters? false



-ScrollbarState <String>

Defines the visibility of the scrollbar. Possible values: "visible", "hidden"



Required? false

Position? 18

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SnapOnInput [<SwitchParameter>]

Enable the SnapOnInput setting.



Required? false

Position? named

Default value True

Accept pipeline input? False

Accept wildcard characters? false



-StartingDirectory <String>

The working directory to start in.



Required? false

Position? 9

Default value %USERPROFILE%

Accept pipeline input? False

Accept wildcard characters? false



-TabTitle <String>

Overrides default title of the tab.



Required? false

Position? 19

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-UseAcrylic [<SwitchParameter>]

Enable acrylic effects.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

None







NOTES









-------------------------- Example 1 --------------------------



PS C:\\> New-MSTerminalProfile -Name pwsh -CommandLine "C:\\Program Files\\PowerShell\\6\\pwsh.exe -WorkingDirectory ~"

-Background "#012456" -ColorScheme Campbell



Adds a profile named pwsh that runs PowerShell core



RELATED LINKS