이 문서에서는 Windows IoT 및 Nano Server에 PowerShell을 설치하는 방법을 설명합니다.
Windows 11 IoT에 배포
Windows 11 IoT Enterprise는 PowerShell 7을 배포하는 데 사용되는 Windows PowerShell과 함께 제공됩니다.
# Replace the placeholder information for the following variables:
$deviceip = '<device ip address>'
$zipfile = 'PowerShell-7.5.4-win-arm64.zip'
$downloadfolder = 'U:\Users\Administrator\Downloads'
# The download location is local to the device.
# There should be enough space for the zip file and the unzipped contents.
# Create PowerShell session to target device
Set-Item -Path WSMan:\localhost\Client\TrustedHosts $deviceip
$S = New-PSSession -ComputerName $deviceIp -Credential Administrator
# Copy the ZIP package to the device
Copy-Item $zipfile -Destination $downloadfolder -ToSession $S
#Connect to the device and expand the archive
Enter-PSSession $S
Set-Location U:\Users\Administrator\Downloads
Expand-Archive .\PowerShell-7.5.4-win-arm64.zip
# Set up remoting to PowerShell 7
Set-Location .\PowerShell-7.5.4-win-arm64
# Be sure to use the -PowerShellHome parameter otherwise it tries to create a new
# endpoint with Windows PowerShell 5.1
.\Install-PowerShellRemoting.ps1 -PowerShellHome .
PowerShell 원격을 설정하면 오류 메시지가 표시되고 디바이스에서 연결이 끊어집니다. PowerShell은 WinRM을 다시 시작해야 합니다. 이제 디바이스에서 PowerShell 7 엔드포인트에 연결할 수 있습니다.
# Be sure to use the -Configuration parameter. If you omit it, you connect to Windows PowerShell 5.1
Enter-PSSession -ComputerName $deviceIp -Credential Administrator -Configuration PowerShell.7.5.4
Windows 11 IoT Core는 IOT_POWERSHELL 기능을 포함할 때 Windows PowerShell을 추가합니다. Windows PowerShell을 사용하여 Windows 11 IoT Enterprise와 동일한 단계를 사용하여 PowerShell 7을 배포합니다.
배송 이미지에 최신 PowerShell을 추가하려면 Import-PSCoreRelease 명령을 사용하여 패키지를 작업 영역에 포함하고 이미지에 OPENSRC_POWERSHELL 기능을 추가합니다.
비고
ARM64 아키텍처의 경우 IOT_POWERSHELL을 포함할 때 Windows PowerShell이 추가되지 않습니다. 따라서 zip 기반 설치가 작동하지 않습니다.
Import-PSCoreRelease 명령을 사용하여 이미지에 추가해야 합니다.
Nano 서버에 배포
이러한 지침에서는 Nano 서버가 모니터 없이 이미 PowerShell 버전이 실행되고 있는 OS라고 가정합니다. 자세한 내용은 Nano 서버 이미지 작성기 설명서를 참조하세요.
PowerShell 이진 파일은 두 가지 방법을 사용하여 배포할 수 있습니다.
- 오프라인 - Nano 서버 VHD를 연결하고 zip 파일의 내용을 연결된 이미지 내의 선택한 위치로 압축 해제합니다.
- 온라인 - PowerShell 세션을 통해 zip 파일을 전송하고 선택한 위치에서 압축을 풉니다.
두 경우 모두 Windows x64 ZIP 릴리스 패키지가 필요합니다. PowerShell의 "관리자" 인스턴스 내에서 명령을 실행합니다.
PowerShell의 오프라인 배포
- 자주 사용하는 zip 유틸리티로 패키지를 탑재된 Nano 서버 이미지 내의 디렉터리에 압축을 풉니다.
- 이미지를 분리하고 부팅합니다.
- Windows PowerShell의 기본 제공 인스턴스에 연결합니다.
PowerShell의 온라인 배포
다음 단계를 사용하여 Nano 서버에 PowerShell을 배포합니다.
# Replace the placeholder information for the following variables:
$ipaddr = '<Nano Server IP address>'
$credential = Get-Credential # <An Administrator account on the system>
$zipfile = 'PowerShell-7.5.4-win-x64.zip'
# Connect to the built-in instance of Windows PowerShell
$session = New-PSSession -ComputerName $ipaddr -Credential $credential
# Copy the file to the Nano Server instance
Copy-Item $zipfile C:\ -ToSession $session
# Enter the interactive remote session
Enter-PSSession $session
# Extract the ZIP file
Expand-Archive -Path C:\PowerShell-7.5.4-win-x64.zip -DestinationPath 'C:\Program Files\PowerShell 7'
지원되는 Windows 버전
Microsoft는 PowerShell이 지원 종료에 도달 하거나 Windows 버전이 지원 종료에 도달할 때까지 PowerShell 을 지원합니다.
.NET SDK용 Docker 이미지에는 최신 버전의 PowerShell이 포함되어 있습니다. 이러한 이미지는 Microsoft 아티팩트 레지스트리에서 사용할 수 있습니다.
이러한 이미지에는 최신 보안 업데이트가 없을 수 있습니다. 최신 보안 업데이트가 적용되도록 OS 패키지를 최신 버전으로 업데이트하는 것이 좋습니다.
이러한 이미지는 테스트 목적으로 제공됩니다. 프로덕션 워크로드에 Docker 이미지가 필요한 경우 직접 빌드하고 유지 관리해야 합니다.
비고
특정 버전의 Windows에 대한 지원은 Microsoft 지원 수명 주기 정책에 따라 결정됩니다. 자세한 내용은 다음을 참조하세요.
를 실행 winver.exe하여 사용 중인 버전을 확인할 수 있습니다.
설치 지원
Microsoft는 이 문서의 설치 방법을 지원합니다. 다른 원본에서 사용할 수 있는 다른 타사 설치 방법이 있을 수 있습니다. 관련 도구 및 방법이 유효하더라도 Microsoft에서는 해당 방법을 지원할 수 없습니다.
비고
이 문서의 설치 명령은 안정적인 최신 PowerShell 릴리스용입니다. 다른 버전의 PowerShell을 설치하려면 필요한 버전과 일치하도록 명령을 조정합니다. 다음 링크는 GitHub의 각 버전에 대한 최신 릴리스 페이지로 안내합니다.
- 안정적인 릴리스 v7.5. x: https://aka.ms/powershell-release?tag=stable
- LTS 릴리스 v7.4. x: https://aka.ms/powershell-release?tag=lts
- 미리 보기 릴리스 v7.6.0-preview. x: https://aka.ms/powershell-release?tag=preview
모든 패키지에 대한 다운로드 링크는 릴리스 페이지의 자산 섹션에 있습니다. 자산 섹션이 축소될 수 있으므로 확장하려면 클릭해야 할 수 있습니다.
PowerShell