Microsoft’s PowerShell is without question a very powerful management tool/automation tool, especially for those who use Windows. Many developers have also started to embrace PowerShell and it has even seen native releases for MacOS and Linux. Thanks to the magic of Chrome OS and Crostini, it can also be installed on a Chromebook, here is how:
Note : This will only work for AMD64/X64 Chrome OS devices. It may be possible to manually build the source code for ARM but that is currently out of scope for this article.
Go ahead and fire up your favorite terminal application and run the following:
sudo apt install curl gnupg apt-transport-https liblttng-ust-ctl2 liblttng-ust0 libunwind8 liburcu4 wget curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/microsoft.list' sudo apt-get update sudo apt-get install -y powershell sudo apt-get install -f
Once the installation is complete, you will have a working version of PowerShell setup on your Chrome OS device. Unlike other applications, there will not be a Chrome Launcher Icon for PowerShell, you instead need to launch it via a command line via a Terminal by typing “pwsh”
What many new to PowerShell on Linux may not know is that it can run many standard bash commands (such as ls, mkdir, rm, etc) and it will also run the Windows-like versions (dir, mkdir, del, etc) at the same time. If you want to get started with PowerShell on Linux, I highly recommend the book “PowerShell 6.0 Linux Administration Cookbook” as it provides several excellent examples specifically tailored to Linux.