The Universal PowerShell Core Installer (Install-PowerShell.sh)

Search for a command to run...

No comments yet. Be the first to comment.
Why Least Privilege Security Engineering Is Frequently Skipped or Done Loosely In a previous life, I was on a team that reviewed the IAM policies specified by developers when they created new Cloud applications or required additional permissions for ...

Obscuring sensitive information like AWS account IDs in screenshots and videos is tedious and error-prone. Even with video editing tools that simplify the process, I still have to repeatedly add and remove blurring boxes as the view changes. You know...

AWS CloudShell joins the ranks of hostless shells for operating in your cloud environment. Cloud shells are a huge help to training and enablement scenarios because they remove the pain of fussy configuration of a user-owned endpoint - which can have...

This article is the third and final of a series. Part 1 justified that human-performed DevOps checklists are essentially source code, and according to GitOps principles, belong in Git just like any other code required for successfully managing a soft...

There are always those who feel checklists are an unnecessary waste of time because they think they can always remember the basics of the steps involved to complete a task. Many are also not aware of the huge, cross-discipline benefits that can come ...

Since PowerShell Core was announced not quite a year ago, I have had a surprising number of reasons to migrate or refit existing PowerShell code to run on PowerShell Core. In some cases keeping future development compatible with both environments adds strategic value.
The PowerShell Core project on github did have an early version of a multi-distro installer, but it required manual tweaks to be updated for each new release and was not using the repository links Microsoft has been putting up.
I believe the ability to quickly setup a sandbox environment is a critical capability for the adoption of any new technology. So, within the PowerShell Core open source project, I set out to build a universal installer that could be used to get the latest version, from repositories (to make updates easier) and optionally install a development environment consisting of Visual Studio Code and the VS Code PowerShell Extension.
The term “Design Goals” makes it sound like they are either accomplished or not, when in reality many design priorities are “desirable in varying degrees”.
Desktop environments were tested in order to install and test VS Code, but this simultaneously tests that PowerShell Core can be installed by iteslf on these distros without a desktop environment.
The install command line is also in comments at the top of the installation script - so they are always easy to find. Curl can be used in place of wget - see the script comments for examples.
You should always examine any internet sourced code you are going to run before you run it, you can review install-powershell.sh and it’s sub-scripts (installpsh*.sh) here: https://github.com/PowerShell/PowerShell/tree/master/tools
The installer supports the following switches:
Oneliner Install Only PowerShell Core on Whatever Distro is Running
bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh)
Oneliner Install PowerShell Core and Visual Studio Code with PowerShell Extension (for development machines - requires a desktop enviroment)
bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) -includeide
Oneliner Install PowerShell Core with IDE and Do Some Interactive Tests (human interaction required)
bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) -includeide -interactivetesting
If you have any contributions or suggestions for this installer, be sure to create an issue on the PowerShell Project here https://github.com/powershell/powershell/issues and mention @DarwinJS to get my attention.
If you are seeking support for an a new distro or OS version the installer does support, it is very helpful if you:
It is most helpful to have a copy of tested code in a pull request (or recorded in the issue itself if you do not have the time for a pull request). The reason is that it can be very challenging to create test environments for all the variations to test that engineered code is working as expected - but, by contrast, it may be very easy for you to provide such code if you’ve already built it.
The code is also developed in a way that should make it fairly easy to create your own installer for proprietary or edge case situations that it would not make sense to work into the open source installer.
This installer is now being used by the PowerShell Core continuous integration pipeline to install PowerShell core in preparation for testing the latest release.
PowerShell Open Source Project: https://github.com/PowerShell/PowerShell