Gérer Powershell et rendre le terminal Windows utilisable







Ce n'est un secret pour personne que par défaut, le terminal de Windows est toujours une béquille. Le terminal standard a été remplacé par le terminal Powershell en 2006. Ensuite, bien qu'il s'agisse d'une percée, le terminal n'était toujours pas aussi pratique qu'il l'était sous Linux avec son Bash. Microsoft a proposé une syntaxe de commande plutôt mauvaise -



, qui formait la base de toute la syntaxe de Powershell et ne vous permettait pas de travailler rapidement avec le terminal. Pas immédiatement, mais après plusieurs versions, des alias ont été ajoutés, au début ils ont imité les commandes de cmd, puis ils ont adopté des commandes bash comme cp, mv, rm, ps et ainsi de suite (en fait, ce ne sont pas des commandes, mais simplement des abréviations qui voir les commandes Powershell standard).







Dans ce mini-article, je vais essayer de résoudre les problèmes de l'émulateur de terminal gênant dans Windows, ainsi que le manque de fonctionnalités.







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 <_>
      
      







Bien que le terminal de Windows ne soit toujours pas aussi fonctionnel, je pense que tôt ou tard, cela changera, ne serait-ce qu'en raison de l'intégration de Linux dans Windows (WSL). Je pense que vous pouvez déjà utiliser le terminal calmement, car les gens continuent à proposer quelque chose de nouveau pour insuffler une nouvelle vie à l'émulateur de terminal Windows.







Si vous étiez intéressé, vous pouvez lire mon blog dans le panier , il y a beaucoup de choses intéressantes sur le monde de Linux, ainsi que sur le développement Web.








All Articles