用于免交互安装Python Install Manager、卸载以及在部署工具中检测安装状态的命令。只列出确定可用的命令:来自清单文件,或来自安装程序技术的官方默认参数。
相关教程: 静默安装参数大全:MSI、NSIS、Inno Setup · 用注册表或PowerShell卸载程序
使用winget
PowerShell
winget install --id Python.PythonInstallManager -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Python.PythonInstallManager -e --silentwinget uninstall --id Python.PythonInstallManager -e --silent按安装包
64位 · MSIX
静默安装
Add-AppxPackage -Path python-manager-26.4.msix卸载
Get-AppxPackage -Name PythonSoftwareFoundation.PythonManager | Remove-AppxPackage- 安装目录
- %ProgramFiles%\WindowsApps\PythonSoftwareFoundation.PythonManager_25.1.240.0_x64__3847v3x7pw1km
64位 · MSI · 所有用户
静默安装
msiexec /i python-manager-26.4.msi /qn /norestart输出日志
msiexec /i python-manager-26.4.msi /qn /norestart /l*v "%TEMP%\python-install-manager-install.log"卸载
msiexec /x {F3923B44-01DC-4ED3-8C2A-171B051A2D98} /qn /norestart- MSI产品代码
- {F3923B44-01DC-4ED3-8C2A-171B051A2D98}
- 卸载注册表项
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F3923B44-01DC-4ED3-8C2A-171B051A2D98}
- UpgradeCode
- {E8B0C18E-35FD-4D63-BDEF-CE8B9E322FE5}
- 安装目录
- %ProgramFiles%\PyManager
PowerShell:下载、校验、安装
下载官方文件,校验SHA256后静默安装。
install-python-install-manager.ps1
$url = 'https://www.python.org/ftp/python/pymanager/python-manager-26.4.msix'
$sha256 = '002CFE4F4B63E322E9C8170CEA4D7D97E3E2D18246887325F969BB75F482F4DC'
$file = Join-Path $env:TEMP 'python-manager-26.4.msix'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file install-python-install-manager.ps1
$url = 'https://www.python.org/ftp/python/pymanager/python-manager-26.4.msi'
$sha256 = 'AB8C6B8A484525B000E8E9453FDE0ED6CDEF762DD433622725696A8E1EF2DF4E'
$file = Join-Path $env:TEMP 'python-manager-26.4.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait