This is the ninth day of my participation in the First Challenge 2022. For details: First Challenge 2022.
PowerShell
PowerShell (including Windows PowerShell and PowerShell Core) is a task automation and configuration management framework developed by Microsoft. The.net Framework and. NET Core builds command line interface shell related scripting language, originally as a Windows component, later open source and cross-platform support on August 18, 2016.
Hey, it’s cross-platform, but… Do Linux and macOS users download PowerShell specifically? Use Terminal or Iterm…
Program features
PowerShell has many features, such as:
- Consistent design allows all tools and system data to use the same syntax and naming principles.
- Scripting languages are simple to learn and support existing ones
script
andCommand line tool
. - With a complete extension, software vendors or developers can expand their own use.
- Interprocess data transfer content has strong typing characteristics.
- PowerShell Core automatically detects suitable encoding, automatically recognizes line breaks for Linux and Windows, and cross-platform.
However, what I feel most about is the support for some GNU and Unix commands, such as CD, CAT, etc. And this was supported natively before INSTALLING WSL, and can be more powerful after installing WSL.
The “Vernacular” version
In general, you can think of PowerShell as a “large” CMD (command prompt) that supports OpenSSL, OpenSSH and other utility functions while inheriting existing commands. For example, you can connect to Linux using SSH.
Extensions are also supported, such as using WSL; More functional.
Windows Terminal
Windows Terminal, as the name suggests. Let’s say Terminal on Windows, which is the Terminal emulator.
In fact, since Windows 11, Windows Terminal has said the default version of PowerShell call. For Windows 10, PowerShell has been replaced by Windows Terminal:
Of course, if you are a Win10 user, it doesn’t matter, can be in the Microsoft Store, free download and free update:
Invoking PowerShell
Install, or open Windows Terminal, the PowerShell interface by default:
Call the CMD
Similarly, Windows Terminal supports calling CMD
In fact, Windows Terminal supports customizing any third-party command line.
Just add it to the new TAB:
More
Well, the appeal looks simple can’t be more simple content, does let you originally Win10 blue PowerShell easy to use, good-looking some, but the next is really let you PowerShell more Power scheme.
Custom color matching
The first is to solve the color problem, this is not a good problem, is directly affecting the use of experience. For example, this is PowerShell on Win10, SSH connection to Linux, using Vim to edit:
Don’t worry, it’s not that your computer monitor lacks a color gamut… It’s really hard to see… Item: ◡ (‘ д ´) Blue loot and item added
However, if opened with Windows Terminal, the effect is different:
Of course, this is not the final form. It might still be hard to see, but we can customize the color scheme.
Open Settings:
After that, you can choose the color scheme:
snazzy
The color scheme is not for everyone, so… Teach you how to customize the color scheme.
For example, when I use macOS and Linux, the Terminal color I use is snazzy: github.com/sindresorhu…
I want to use a similar color scheme on Windows Terminal, or PowerShell. This allows you to open the custom file for configuration:
This file, in fact, can change colors, and you can customize other functions of Terminal. Have a chance to talk to you about… (Digging a hole again!)
We are inschemes
Add our own custom color matching:
For example: I added the snazzy color scheme:
{
"background": "#282A36"."black": "#282A36"."blue": "#57C7FF"."brightBlack": "# 686868"."brightBlue": "#57C7FF"."brightCyan": "#9AEDFE"."brightGreen": "#5AF78E"."brightPurple": "#FF6AC1"."brightRed": "#FF5C57"."brightWhite": "#EFF0EB"."brightYellow": "#F3F99D"."cursorColor": "#97979B"."cyan": "#9AEDFE"."foreground": "#EFF0EB"."green": "#5AF78E"."name": "Snazzy"."purple": "#FF6AC1"."red": "#FF5C57"."selectionBackground": "#3E404A"."white": "#F1F1F0"."yellow": "#F3F99D"
},
Copy the code
After saving, go to the home page to activate:
Look at the results:
SSH TAB
Also, I use Windows Terminal with PowerShell and I use SSH TAB functionality.
To be clear, Windows 10 (after 1809, after 2018) supports SSH and is enabled using PowerShell.
So, we can use Windows Terminal with PowerShell SSH to open a TAB that acts like Xshell’s Remember server (Linux) :
After adding this TAB, I just need to click the TAB and enter the password to SSH raspberry PI on my LAN:
Of course, if you want to avoid secret login, you need to configure the certificate
configuration
Now, let’s talk about configuration. It’s as simple as adding and saving in Settings:
END
And that’s all for this share. I was going to introduce WSL… But on my Windows VIRTUAL machine, there really isn’t much room to install another WSL. I’ll leave it to you to experience.
Suffice it to say, the WSL environment is comfortable on Windows Terminal.
If you have a chance, share WSL with everyone (dig another hole)