MacOS에 PowerShell 설치Installing PowerShell on macOS
PowerShell 7.0 이상에는 macOS 10.13 이상이 필요합니다.PowerShell 7.0 or higher require macOS 10.13 and higher. 모든 패키지는 GitHub 릴리스 페이지에 제공됩니다.All packages are available on our GitHub releases page. 패키지를 설치한 후 실행하려면 터미널에서 pwsh
를 실행합니다.After the package is installed, run pwsh
from a terminal.
참고
PowerShell 7.1은 PowerShell Core 6.x 및 7.0을 제거하는 현재 위치 업그레이드입니다.PowerShell 7.1 is an in-place upgrade that removes PowerShell Core 6.x and 7.0.
/usr/local/microsoft/powershell/6
폴더가 /usr/local/microsoft/powershell/7
로 바뀝니다.The /usr/local/microsoft/powershell/6
folder is replaced by /usr/local/microsoft/powershell/7
.
이전 버전의 PowerShell Core를 PowerShell 7.1과 함께 실행해야 하는 경우 이진 보관 메서드를 사용하여 원하는 버전을 설치합니다.If you need to run and older version of PowerShell core side-by-side with PowerShell 7.1, install the version you want using the binary archive method.
macOS에 PowerShell을 설치하는 방법에는 여러 가지가 있습니다.There are several ways to install PowerShell on macOS. 다음 방법 중 하나를 선택합니다.Choose one of the following methods:
- Homebrew를 사용하여 설치.Install using Homebrew. Homebrew는 macOS용 기본 패키지 관리자입니다.Homebrew is the preferred package manager for macOS.
- 직접 다운로드를 통해 PowerShell 설치Install PowerShell via Direct Download
- 이진 보관에서 설치Install from binary archives.
PowerShell을 설치한 후 OpenSSL을 설치해야 합니다.After installing PowerShell, you should install OpenSSL. OpenSSL은 PowerShell 원격 기능 및 CIM 작업에 필요합니다.OpenSSL is needed for PowerShell remoting and CIM operations.
macOS 10.13 이상에서 Homebrew를 통해 안정적인 최신 릴리스 설치Installation of latest stable release via Homebrew on macOS 10.13 or higher
brew
명령이 없을 경우 해당 지침에 따라 Homebrew를 설치해야 합니다.If the brew
command is not found, you need to install Homebrew following their instructions.
이제 PowerShell을 설치할 수 있습니다.Now, you can install PowerShell:
brew install --cask powershell
최종적으로, 설치가 제대로 작동하는지 확인합니다.Finally, verify that your install is working properly:
pwsh
PowerShell의 새 버전이 릴리스되면 Homebrew의 Formula를 업데이트하고 PowerShell을 업그레이드합니다.When new versions of PowerShell are released, update Homebrew's formulae and upgrade PowerShell:
brew update
brew upgrade powershell --cask
참고
위의 명령은 PowerShell(pwsh) 호스트 내에서 호출할 수 있지만 이때 PowerShell 셸을 종료하고 다시 시작하여 업그레이드를 완료하고 $PSVersionTable
에 표시된 값을 새로 고쳐야 합니다.The commands above can be called from within a PowerShell (pwsh) host, but then the PowerShell shell must be exited and restarted to complete the upgrade and refresh the values shown in $PSVersionTable
.
macOS 10.13 이상에서 Homebrew를 통해 최신 미리 보기 릴리스 설치Installation of latest preview release via Homebrew on macOS 10.13 or higher
Homebrew를 설치한 후 PowerShell을 설치할 수 있습니다.After you've installed Homebrew, you can install PowerShell. 먼저 Cask-Versions 패키지를 설치합니다. 그러면 cask 패키지의 대체 버전을 설치할 수 있습니다.First, install the Cask-Versions package that lets you install alternative versions of cask packages:
brew tap homebrew/cask-versions
이제 PowerShell을 설치할 수 있습니다.Now, you can install PowerShell:
brew install --cask powershell-preview
최종적으로, 설치가 제대로 작동하는지 확인합니다.Finally, verify that your install is working properly:
pwsh-preview
PowerShell의 새 버전이 릴리스되면 Homebrew의 Formula를 업데이트하고 PowerShell을 업그레이드합니다.When new versions of PowerShell are released, update Homebrew's formulae and upgrade PowerShell:
brew update
brew upgrade powershell-preview --cask
참고
위의 명령은 PowerShell(pwsh) 호스트 내에서 호출할 수 있지만, 업그레이드를 완료하기 위해 PowerShell 셸을 종료하고 다시 시작해야 합니다.The commands above can be called from within a PowerShell (pwsh) host, but then the PowerShell shell must be exited and restarted to complete the upgrade.
그리고 $PSVersionTable
에 표시된 값을 새로 고칩니다.and refresh the values shown in $PSVersionTable
.
안정적인 LTS 버전의 경우 Homebrew tap 메서드를 사용하여 PowerShell을 설치하는 방법도 지원됩니다.Installing PowerShell using the Homebrew tap method is also supported for stable and LTS versions.
brew install powershell/tap/powershell
이제 설치를 확인할 수 있습니다.You can now verify your install
pwsh
PowerShell의 새 버전이 릴리스되면 간단하게 다음 명령을 실행합니다.When new versions of PowerShell are released, simply run the following command.
brew upgrade powershell
참고
cask 또는 tap 메서드를 사용하는지 여부에 관계없이 최신 버전의 PowerShell로 업데이트하는 경우 처음에 PowerShell을 설치하는 데 사용한 것과 동일한 메서드를 사용합니다.Whether you use the cask or the tap method, when updating to a newer version of PowerShell, use the same method you used to initially install PowerShell. 다른 메서드를 사용하는 경우 새 pwsh 세션을 여는 데는 계속해서 이전 버전의 PowerShell을 사용합니다.If you use a different method, opening a new pwsh session will continue to use the older version of PowerShell.
다른 메서드를 사용하기로 결정하면 Homebrew 연결 메서드를 사용하여 문제를 해결하는 방법이 있습니다.If you do decide to use different methods, there are ways to correct the issue using the Homebrew link method.
직접 다운로드를 통해 설치Installation via Direct Download
릴리스 페이지의 PKG 패키지 powershell-7.1.2-osx-x64.pkg
를 macOS 컴퓨터로 다운로드합니다.Download the PKG package powershell-7.1.2-osx-x64.pkg
from the releases page onto your macOS machine.
파일을 두 번 클릭하고 메시지를 따르거나 터미널에서 설치할 수 있습니다.You can double-click the file and follow the prompts, or install it from the terminal:
sudo installer -pkg powershell-7.1.2-osx-x64.pkg -target /
OpenSSL을 설치합니다.Install OpenSSL. OpenSSL은 PowerShell 원격 기능 및 CIM 작업에 필요합니다.OpenSSL is needed for PowerShell remoting and CIM operations.
.NET 전역 도구로 설치Install as a .NET Global tool
.NET Core SDK가 이미 설치되어 있는 경우 PowerShell을 .NET 전역 도구로 쉽게 설치할 수 있습니다.If you already have the .NET Core SDK installed, it's easy to install PowerShell as a .NET Global tool.
dotnet tool install --global PowerShell
dotnet 도구 설치 프로그램은 PATH
환경 변수에 ~/.dotnet/tools
를 추가합니다.The dotnet tool installer adds ~/.dotnet/tools
to your PATH
environment variable. 그러나 현재 실행 중인 셸에는 PATH
가 업데이트되지 않습니다.However, the currently running shell does not have the updated PATH
. 새 셸에서 pwsh
를 입력하여 PowerShell을 시작할 수 있습니다.You should be able to start PowerShell from a new shell by typing pwsh
.
OpenSSL을 설치합니다.Install OpenSSL. OpenSSL은 PowerShell 원격 기능 및 CIM 작업에 필요합니다.OpenSSL is needed for PowerShell remoting and CIM operations.
이진 아카이브Binary Archives
고급 배포 시나리오를 위해 macOS 플랫폼에 대해 PowerShell 이진 tar.gz
보관이 제공됩니다.PowerShell binary tar.gz
archives are provided for the macOS platform to enable advanced deployment scenarios. 해당 메서드를 사용하여 설치하는 경우 모든 종속성도 수동으로 설치해야 합니다.When you install using this method you must also manually install any dependencies.
OpenSSL을 설치합니다.Install OpenSSL. OpenSSL은 PowerShell 원격 기능 및 CIM 작업에 필요합니다.OpenSSL is needed for PowerShell remoting and CIM operations.
macOS에서 이진 보관 설치Installing binary archives on macOS
# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.1.2/powershell-7.1.2-osx-x64.tar.gz
# Create the target folder where powershell will be placed
sudo mkdir -p /usr/local/microsoft/powershell/7.1.2
# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/7.1.2
# Set execute permissions
sudo chmod +x /usr/local/microsoft/powershell/7.1.2/pwsh
# Create the symbolic link that points to pwsh
sudo ln -s /usr/local/microsoft/powershell/7.1.2/pwsh /usr/local/bin/pwsh
종속성 설치Installing dependencies
OpenSSL은 PowerShell 원격 및 CIM 작업에 필요합니다.OpenSSL is required for PowerShell remoting and CIM operations. 필요한 경우 MacPorts를 통해 OpenSSL를 설치할 수 있습니다.You can install OpenSSL via MacPorts if needed.
참고
MacPorts 및 Homebrew는 동일한 시스템에서 함께 사용될 경우 문제가 있을 수 있습니다.MacPorts and Homebrew can have problems when used to together on the same system. 그러나 Homebrew에는 OpenSSL 1.0용 패키지가 없습니다.However, Homebrew does not have a package for OpenSSL 1.0. 자세한 내용은 MacPorts FAQ를 참조하세요.For more information, see the MacPorts FAQ.
Xcode 명령줄 도구를 설치합니다.Install the Xcode command-line tools. MacPorts에는 Xcode 도구가 필요합니다.The Xcode tools are required by MacPorts.
xcode-select --install
MacPorts를 설치합니다.Install MacPorts. 지침이 필요한 경우 설치 가이드를 참조하세요.If you need instructions, refer to the installation guide.
sudo port selfupdate
를 실행하여 MacPorts를 업데이트합니다.Update MacPorts by runningsudo port selfupdate
.sudo port upgrade outdated
를 실행하여 MacPorts 패키지를 업그레이드합니다.Upgrade MacPorts packages by runningsudo port upgrade outdated
.sudo port install openssl10
을 실행하여 OpenSSL을 설치합니다.Install OpenSSL by runningsudo port install openssl10
.라이브러리를 연결하여 PowerShell에 대해 사용할 수 있도록 만듭니다.Link the libraries to make them available to PowerShell:
sudo mkdir -p /usr/local/opt/openssl sudo ln -s /opt/local/lib/openssl-1.0 /usr/local/opt/openssl/lib
PowerShell 제거Uninstalling PowerShell
Homebrew를 사용하여 PowerShell을 설치한 경우 다음 명령을 사용하여 제거합니다.If you installed PowerShell with Homebrew, use the following command to uninstall:
brew cask uninstall powershell
직접 다운로드를 통해 PowerShell을 설치한 경우에는 PowerShell을 수동으로 제거해야 합니다.If you installed PowerShell via direct download, PowerShell must be removed manually:
sudo rm -rf /usr/local/bin/pwsh /usr/local/microsoft/powershell
추가 PowerShell 경로를 제거하려면 이 문서의 경로 섹션을 참조하고 sudo rm
을 사용하여 경로를 제거합니다.To remove the additional PowerShell paths, refer to the paths section in this document and remove the paths using sudo rm
.
참고
Homebrew를 사용하여 설치한 경우에는 필요하지 않습니다.This is not necessary if you installed with Homebrew.
경로Paths
$PSHOME
은/usr/local/microsoft/powershell/7.1.2/
입니다.$PSHOME
is/usr/local/microsoft/powershell/7.1.2/
- 사용자 프로필은
~/.config/powershell/profile.ps1
에서 읽습니다.User profiles will be read from~/.config/powershell/profile.ps1
- 기본 프로필은
$PSHOME/profile.ps1
에서 읽습니다.Default profiles will be read from$PSHOME/profile.ps1
- 사용자 프로필은
~/.local/share/powershell/Modules
에서 읽습니다.User modules will be read from~/.local/share/powershell/Modules
- 공유 모듈은
/usr/local/share/powershell/Modules
에서 읽습니다.Shared modules will be read from/usr/local/share/powershell/Modules
- 기본 모듈은
$PSHOME/Modules
에서 읽습니다.Default modules will be read from$PSHOME/Modules
- PSReadline 기록은
~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt
에 기록됩니다.PSReadline history will be recorded to~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt
프로필은 PowerShell의 호스트별 구성을 반영합니다.The profiles respect PowerShell's per-host configuration. 따라서 기본 호스트별 프로필은 동일한 위치의 Microsoft.PowerShell_profile.ps1
에 있습니다.So the default host-specific profile exists at Microsoft.PowerShell_profile.ps1
in the same locations.
PowerShell은 macOS의 XDG 기본 디렉터리 사양을 따릅니다.PowerShell respects the XDG Base Directory Specification on macOS.
macOS는 BSD에서 파생된 운영체제이므로 /opt
대신 /usr/local
이 접두사로 사용됩니다.Because macOS is a derivation of BSD, the prefix /usr/local
is used instead of /opt
. 따라서 $PSHOME
은 /usr/local/microsoft/powershell/7.1.2/
이며 기호화된 링크는 /usr/local/bin/pwsh
에 있습니다.So, $PSHOME
is /usr/local/microsoft/powershell/7.1.2/
, and the symbolic link is placed at /usr/local/bin/pwsh
.
설치 지원Installation support
Microsoft는 이 문서의 설치 방법을 지원합니다.Microsoft supports the installation methods in this document. 다른 원본에서 사용 가능한 다른 설치 방법이 있을 수 있습니다.There may be other methods of installation available from other sources. 관련 도구 및 방법이 유효하더라도 Microsoft에서는 해당 방법을 지원할 수 없습니다.While those tools and methods may work, Microsoft cannot support those methods.