getpw: A lightweight, strictly POSIX /bin/sh installer for PowerShell.
A simple, zero-sudo PowerShell installer for Linux systems powered by a single POSIX-compliant /bin/sh script.
As an avid PowerShell user on both Linux and Windows machines, I wanted to provide Linux users with a frictionless, simple way to try and install PowerShell on their systems without requiring root privileges or package manager overhead.
All binaries are downloaded directly from official PowerShell GitHub Releases.
Install latest release:
curl -fsSL https://leblocks.github.io/getpw/sh | sh
Install a specific version:
curl -fsSL https://leblocks.github.io/getpw/sh | sh -s -- 7.4.6
Alternative with wget:
wget -qO- https://leblocks.github.io/getpw/sh | sh
Quick Docker Tests (installs and drops directly into pwsh):
Alpine:
docker run --rm -it alpine:3.23 sh -c "apk add --no-cache icu-libs libstdc++ && wget -qO- https://leblocks.github.io/getpw/sh | sh && ~/pwsh/current/pwsh"
Debian:
docker run --rm -it debian:bookworm-slim sh -c "apt-get update -qq && apt-get install -y -qq curl ca-certificates libicu72 && curl -fsSL https://leblocks.github.io/getpw/sh | sh && ~/pwsh/current/pwsh"
Ubuntu:
docker run --rm -it ubuntu:24.04 sh -c "apt-get update -qq && apt-get install -y -qq curl ca-certificates libicu74 && curl -fsSL https://leblocks.github.io/getpw/sh | sh && ~/pwsh/current/pwsh"
${HOME}/pwsh/<version> without needing root or modifying system-level directories.${HOME}/pwsh/current pointing to the active installation./bin/sh: Zero bashisms. Verified with shellcheck -s sh and tested across ash (Alpine), dash (Debian), and bash (Ubuntu).glibc + x64glibc + arm64musl + x64musl + arm64Running PowerShell directly:
~/pwsh/current/pwsh
Adding to PATH (~/.bashrc, ~/.zshrc, or ~/.profile):
export PATH="$HOME/pwsh/current:$PATH"
Set as Default Login Shell (Optional, requires sudo):
sudo sh -c 'grep -qxF "$HOME/pwsh/current/pwsh" /etc/shells || echo "$HOME/pwsh/current/pwsh" >> /etc/shells'
chsh -s "$HOME/pwsh/current/pwsh"
AI Disclosure: AI assistance was utilized in designing, authoring, and verifying this project.