Beautify PowerShell

Disclaimer: This article is a blogger sigmarising original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/sigmarising/article/details/90763423

Beautify PowerShell


1. Preparations

Step1. Download and install PowerShell Core (pwsh), available at Github page to download.

PowerShell Core lot of advantages compared to traditional PowerShell, here recommended to install

Step2. Ensure that the Windows version on v1903 (you can run winverto view it)

After the 1903 version of Windows10, it brought a new conpty, to solve a lot of bug originally winpty

Step3. Installation VSCode and PowerLine fonts


2. Install PowerShell module

Run as administrator PowerShell, and execute the command:

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

(Optional) Installation Preview PSReadLine:

Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck

3. Create a startup configuration file

Excuting an order:

if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
notepad $PROFILE

Edit and save the following:

chcp 65001
Import-Module posh-git 
Import-Module oh-my-posh 
Set-Theme Agnoster

4. Configure Pwsh font and color themes

Start pwsh, configurable font from the title bar right> properties recommended PowerLine font.

In the Microsoft / Terminal warehouse and can be downloaded to ColorTool tool that can be applied iTerm2-Color-Schemes warehouse theme of color.

Use:

./colortool -b $THEME_FILE

Next the title bar Right> Properties, then do nothing, just click OK, you can put the current console switches and console default color scheme.


Built terminal 5. VSCode

We need to configure the terminal shell and fonts :
Font and procedures

In addition, we need to enable Conpty :
conpty


6. Final results

final


Reference links

Guess you like

Origin blog.csdn.net/sigmarising/article/details/90763423