Created
November 1, 2022 07:44
-
-
Save stknohg/fd1691b0519042cc853252eaf3e93537 to your computer and use it in GitHub Desktop.
Arm版LinuxにPowerShell 7をインストールするスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Download Arm PowerShell tar.gz | |
ver_name=$(curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest | grep tag_name | sed -e 's/^\s*"tag_name".*"v\(.*\)".*$/\1/') | |
curl -L -o /tmp/powershell.tar.gz "https://github.com/PowerShell/PowerShell/releases/download/v${ver_name}/powershell-${ver_name}-linux-arm64.tar.gz" | |
# Create the target folder and expand PowerShell | |
sudo mkdir -p /opt/microsoft/powershell/7 | |
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 | |
# Set pwsh binary executable | |
sudo chmod +x /opt/microsoft/powershell/7/pwsh | |
sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ubuntu 22.04 on WSL on Armで動作確認済み。