Alpine Linux에 PowerShell 설치
모든 패키지는 GitHub 릴리스 페이지에서 사용할 수 있습니다 . 패키지가 설치된 후 터미널에서 pwsh
를 실행합니다. 미리 보기 릴리스를 설치한 경우 pwsh-preview
를 실행합니다. 설치하기 전에 아래 지원되는 버전 목록을 검사.
참고 항목
PowerShell 7.3은 PowerShell의 이전 버전을 제거하는 현재 위치 업그레이드입니다.
PowerShell 7.3을 이전 버전과 함께 실행해야 하는 경우 이진 보관 방법을 사용하여 이전 버전을 다시 설치합니다.
설치 단계
Alpine에 설치하려면 먼저 릴리스 페이지에서 tar.gz 패키지를 다운로드합니다. 패키지의 URL은 설치하려는 PowerShell 버전에 따라 달라집니다.
- PowerShell 7.3.7 -
https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-alpine-x64.tar.gz
- PowerShell 7.2.14 -
https://github.com/PowerShell/PowerShell/releases/download/v7.2.14/powershell-7.2.14-linux-alpine-x64.tar.gz
그런 다음 터미널에서 다음 셸 명령을 실행하여 PowerShell 7.3을 설치합니다.
# install the requirements
sudo apk add --no-cache \
ca-certificates \
less \
ncurses-terminfo-base \
krb5-libs \
libgcc \
libintl \
libssl1.1 \
libstdc++ \
tzdata \
userspace-rcu \
zlib \
icu-libs \
curl
sudo apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \
lttng-ust
# Download the powershell '.tar.gz' archive
curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.3.7/powershell-7.3.7-linux-alpine-x64.tar.gz -o /tmp/powershell.tar.gz
# Create the target folder where powershell will be placed
sudo mkdir -p /opt/microsoft/powershell/7
# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7
# Set execute permissions
sudo chmod +x /opt/microsoft/powershell/7/pwsh
# Create the symbolic link that points to pwsh
sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
# Start PowerShell
pwsh
Alpine에서 PowerShell 제거
sudo rm -rf /usr/bin/pwsh /opt/microsoft/powershell
PowerShell 경로
$PSHOME
가/opt/microsoft/powershell/7/
인 경우- 사용자 프로필은 에서 읽습니다.
~/.config/powershell/profile.ps1
- 기본 프로필은 에서 읽습니다.
$PSHOME/profile.ps1
- 사용자 모듈은 에서 읽습니다.
~/.local/share/powershell/Modules
- 공유 모듈은 에서 읽습니다.
/usr/local/share/powershell/Modules
- 기본 모듈은 다음에서 읽습니다.
$PSHOME/Modules
- PSReadLine 기록은
~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt
에 기록됩니다.
프로필은 PowerShell의 호스트별 구성을 준수하므로 기본 호스트별 프로필은 동일한 위치에 존재합니다 Microsoft.PowerShell_profile.ps1
.
PowerShell은 Linux의 XDG 기본 디렉터리 사양을 따릅니다.
지원되는 버전
다음 표에는 지원되는 PowerShell 릴리스 및 해당 릴리스가 지원되는 Alpine 버전이 나와 있습니다. 이러한 버전은 PowerShell 지원 종료 버전 또는 Alpine 지원 종료 버전까지 지원됩니다.
- 아이콘은
OS 또는 PowerShell의 버전이 계속 지원됨을 나타냅니다.
- 아이콘은
해당 버전의 OS에서 PowerShell 버전이 더 이상 지원되지 않음을 나타냅니다.
- 아이콘은
해당 OS에서 PowerShell 테스트를 완료하지 않았음을 나타냅니다.
- 아이콘은
OS 또는 PowerShell의 버전이 지원되지 않음을 나타냅니다.
- OS 버전과 PowerShell 버전 모두 아이콘이 있는
경우 해당 조합이 지원됩니다.
Alpine | 7.2(LTS-current) | 7.3 | 7.4(미리 보기) |
---|---|---|---|
Alpine 3.15는 테스트 중입니다.
PowerShell은 다음 프로세서 아키텍처에 대해 Alpine에서 지원됩니다.
Alpine | 7.2(LTS-current) | 7.3 | 7.4(미리 보기) |
---|---|---|---|
지원되는 모든 버전 | X64 | X64 | X64 |
PowerShell은 Arm 프로세서를 사용하여 Alpine에서 테스트되지 않았습니다.
설치 지원
Microsoft는 이 문서의 설치 방법을 지원합니다. 다른 타사 원본에서 사용할 수 있는 다른 설치 방법이 있을 수 있습니다. 관련 도구 및 방법이 유효하더라도 Microsoft에서는 해당 방법을 지원할 수 없습니다.
PowerShell
A cross-platform task automation solution made up of a command-line shell and a scripting language.
피드백
다음에 대한 사용자 의견 제출 및 보기