Dealing with Powershell and making the Windows terminal usable







It's no secret that by default the terminal in Windows is still a crutch. The standard terminal was replaced by the Powershell terminal in 2006. Then, although it was a breakthrough, the terminal was still not as convenient as it was on Linux with its Bash. Microsoft came up with a rather bad command syntax -



, which formed the basis of the entire Powershell syntax and did not allow you to quickly work with the terminal. Not immediately, but after several releases, aliases were added, at first they imitated commands from cmd, and then they adopted bash commands like cp, mv, rm, ps and so on (in fact, these are not commands, but simply abbreviations that refer to to standard Powershell commands).







In this mini-article I will try to solve the problems of the inconvenient terminal emulator in Windows, as well as the lack of some functionality in it.







5- (Zsh, Bash, Fish..) - , . . Powershell . . , , . , , .







, Linux?



Linux. , , , . - , , Linux, - , , - , , , - - . , .







Windows , , , , , ( ) , .







Windows — . Linux-like.







Windows Terminal



Windows Terminal. .json



. — . , , (Ctrl + Alt + ,



), ,













colorScheme



, , . .







, , Linux, , .







Powershell



. , , . . 2 : , , , Git', , , , - , ( fish) — .







, , oh-my-posh. :







Install-Module oh-my-posh -Scope CurrentUser #   oh-my-posh
Install-Module posh-git -Scope CurrentUser #    ,    git'
      
      





, Get-Theme



, Set-Theme



:







PS C:\Users\Daniil_Shilo> Get-Theme

Name                  Type     Location
----                  ----     --------
Agnoster              Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\A...
AgnosterPlus          Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\A...
Avit                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\A...
cypher                Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\c...
Darkblood             Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\D...
Emodipt               Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\E...
Fish                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\F...
Honukai               Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\H...
Lambda                Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\L...
Material              Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\M...
Operator              Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\O...
Paradox               Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Pararussel            Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Powerlevel10k-Classic Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Powerlevel10k-Lean    Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Powerlevel9k          Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
PowerLine             Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
PowerlinePlus         Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
Punk                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\P...
pure                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\p...
qwerty                Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\q...
robbyrussell          Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\r...
Sorin                 Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\S...
Star                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\S...
tehrob                Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\t...
ys                    Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\y...
Zash                  Defaults C:\Users\Daniil_Shilo\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.496\Themes\Z...

Set-Theme ys
      
      











. , .









, Chocolatey. , , Linux- ( ).







:







Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
      
      





Chocolatey, - Google Chrome, Firefox, Docker, VSCode, . , Windows,







, Chocolatey, . . , Approved.




Chocolatey Powershell, , Linux. search.







% choco search Google Chrome
Chocolatey v0.10.15
GoogleChrome 88.0.4324.146 [Approved]
google-hangouts-chrome 2017.110.418.20 [Approved]
google-translate-chrome 2.0.7 [Approved]
...
      
      







( ).







% choco install <_>
      
      





:







% choco list --local-only
      
      





- :







% choco uninstall <_>
      
      







Although the terminal in Windows is still not as functional, I believe that sooner or later this will change, if only due to the integration of Linux into Windows (WSL). I think you can already use the terminal calmly, because people keep coming up with something new to breathe new life into the Windows terminal emulator.







If you were interested, you can read my blog in the cart , there is a lot of interesting things about the world of Linux, as well as about web development.








All Articles