Done recently discovered this shell. It also helped to look for books that, by the way, had already been translated and can be taken
from here . And everything seems to be good, and the code is written easily and integration with vsb-skipty, but, for some reason, pulls me to the windows.
And so, it was decided to repaint the PowerShell window to the standard color cmd and at the same time adjust the autorun of its own functions and aliases. Also, slightly, I strained the sentences with the inscription - PS, which, together with the color, resembles the Adobe Photoshop logo (I have nothing against Adobe).
So, the information behind is exclusively for beginners.First we start the shell, we see the usual window:

')
First , we will need permissions to run individual scripts with the ps1 extension.
You can view them by running the command:
Get-ExecutionPolicy
The default policy is:
Restricted , which prohibits the execution of any scripts.
There are three options.
1. Either change the policy to
AllSigned and sign the scripts (you can read more by running the
get-help about_signing command ).
2. Either name the policy on
RemoteSigned , allowing you to run all the scripts, with the exception of downloaded from the network.
3. Or change the policy to
Unrestricted , which allows you to execute any scripts, with the exception of those downloaded, for which a request will be issued.
I chose the second path, it is, nevertheless, safer. Therefore, changing the policy team:
Set-ExecutionPolicy RemoteSigned

We receive a request to change the policy to which you need to answer
Y (yes).
Secondly , create a script that will run with PowerShell:
New-Item -type file $PROFILE
In theory, at this point, such an error might pop up:

But that's okay, the shell writes that there is no
Windows PowerShell folder in
My Documents , create it and repeat the command:

As we can see, an empty file was created with the name
Microsoft.PowerShell_profile.ps1 .
We did half the work. We have permissions to execute scripts and a default script has been created.
Third , we need to learn how to get and change information about the shell.
The
Get-Host cmdlet does just that:

The
UI property is actually an object, and if we enter
(Get-Host) .UI , we will see that this object also has the
RawUI property, which contains the settings we need:
(Get-Host).UI.RawUI

You can change these settings as follows:
(Get-Host).UI.RawUI.WindowTitle = “” (Get-Host).UI.RawUI.BackgroundColor = “Black” cls
It is important that in order for the changed settings to be immediately displayed on the screen, we need to register the
cls responsible for clearing the screen.
This is of course all cool, but the settings are reset if you close the window, so we write them into a file that is loaded with the shell at the start. Edit the
Microsoft.PowerShell_profile.ps1 file like this:
And now shortly by code.
The first 4 properties are responsible for setting up the window, after setting the properties we make a mandatory cleaning -
cls .
Cd $ MyRoot; - is responsible for what directory when we load the shell we will be.
The promt function is a standard modified function that is responsible for the appearance of the input line. I removed the
PS and added my nickname.
Save the file, restart the shell.
It looks like this:

And lastly, in the
Microsoft.PowerShell_profile.ps1 file
, you can easily write your own ones. Let's say
set-alias WeToFuck Get-Process
Thank you all, good luck in mastering this beautiful shell.