Windows パッケージ マネージャーである WinGet は、ユーザーが Windows クライアント コンピューター上のアプリケーションを検出、インストール、アップグレード、削除、および構成できるコマンドライン ツールです。 このツールは、Windows パッケージ マネージャー サービスに対するクライアント インターフェイスです。 winget コマンドライン ツールは、既定では、アプリ インストーラーとして Windows 11 と最新バージョンの Windows 10 にバンドルされています。
注意
システム要件とインストール手順の一覧については、winget に関するドキュメントを参照してください。
winget は、Windows Server 2022 以前のバージョンでは使用できません。 Windows Server 2025 プレビュー ビルド 26085 以降には、デスクトップ エクスペリエンスwingetのみを備えた Windows Server 用の が含まれています。
Name Id Version Source
---------------------------------------------------------------
PowerShell Microsoft.PowerShell 7.5.0.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.6.0.2 winget
id パラメーターを使用して PowerShell または PowerShell プレビューをインストールします
X86 または X64 プロセッサを使う Windows システムの場合、winget によって MSI パッケージがインストールされます。 Arm64 プロセッサを使うシステムの場合、winget によって Microsoft Store (MSIX) パッケージがインストールされます。 詳細については、「Microsoft Store からインストールする」を参照してください。
この方法を使用して、Microsoft Surface Pro X のようなコンピューターに ARM ベース バージョンの PowerShell をインストールします。最適な結果を得るには、PowerShell を $env:ProgramFiles\PowerShell\7 フォルダーにインストールします。
Windows 10 IoT Enterprise には、PowerShell 7 の展開に使用できる Windows PowerShell が付属しています。
# Replace the placeholder information for the following variables:
$deviceip = '<device ip address'
$zipfile = 'PowerShell-7.5.0-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.0-win-arm64.zip
# Set up remoting to PowerShell 7
Set-Location .\PowerShell-7.5.0-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 .
# 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.0
Windows 10 IoT Core への展開
PowerShell 7 の展開に使用できる IOT_POWERSHELL 機能を取り込む場合、Windows 10 IoT Core によって Windows PowerShell が追加されます。 上記で Windows 10 IoT Enterprise に対して定義した手順は、IoT Core にも適用できます。
お好みの zip ユーティリティを使用して、マウントされた Nano Server イメージ内のディレクトリにパッケージを解凍します。
イメージをマウント解除し、ブートします。
Windows PowerShell の組み込みインスタンスに接続します。
PowerShell のオンラインでの展開
次の手順に従って、PowerShell を Nano Server に展開します。
# 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.0-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.0-win-x64.zip -DestinationPath 'C:\Program Files\PowerShell 7'