Command line beautification tutorial (powershell)
"TLDR: This article introduces how to beautify in `powershell` under Windows, including modifying the theme, changing the background image and transparency, etc. The article first introduces how to install the .net version of `Powershell`, and then run specific commands to modify the theme and set the background image. Finally, the author emphasizes maintaining an understanding of basic DOM operations and not over-relying on modern front-end tools."
written in front
Rage: The end of computer beautification is default,
But what could be more pleasing to the eyes of programmers than a fancy terminal? The beautification target this time is powershell under Windows
Finished product display:
step1Modify the theme
If there is no window terminal in the computer, then install it first
Search for powershell in the search bar
If the .net version of powershell has not been installed on the computer, the search results will only be Windows Powershell (I have already installed it here). Windows Powershell seems to be an older version, so you need to install the latest Powershell in the Microsoft Store.
Run the following commands in the new version of powershell:
oh-my-posh -Scope CurrentUser
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
notepad $profile
Then write in the pop-up text document (remember the location of this file, you will need to modify the third line in this file when you change the theme later)
Import-Module posh-git
Import-Moduleoh-my-posh
Set-PoshPrompt material
Restart powershell (by the way, if git is not installed, just go to the official website to install it)
Enter Get-PoshThemes and you will see a bunch of optional themes
Find a theme you like, remember the name, write it into the text document above (that is, change material to the name of the new theme), and restart PowerShell again to take effect.