Skip to content

Instantly share code, notes, and snippets.

@stknohg
Created November 1, 2022 07:44
Show Gist options
  • Save stknohg/fd1691b0519042cc853252eaf3e93537 to your computer and use it in GitHub Desktop.
Save stknohg/fd1691b0519042cc853252eaf3e93537 to your computer and use it in GitHub Desktop.
Arm版LinuxにPowerShell 7をインストールするスクリプト
#!/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
@stknohg
Copy link
Author

stknohg commented Nov 1, 2022

Ubuntu 22.04 on WSL on Armで動作確認済み。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment