voi*_*ces 6 windows package-management repository windows-10 windows-packagemanagement
现在 Windows 有包管理器吗?我好多年没用过 Windows 了。我希望它有类似的东西yum,apt,pacman,等各种Linux发行版中。显然 Windows 不是 Linux,但听起来 Windows 和 PowerShell 等已经走了很长一段路。
例如,我希望能够从批处理脚本自动安装当前版本的 Python,而无需所有单调的 GUI 导航。那种事。
是的,Windows 10 PowerShell 具有PackageManagement。对于python,我相信你需要先安装chocolatey作为包提供者。
这是我如何使用 PackageManagement 安装 python。
Install-PackageProvider chocolateyFind-Package python
这显示了 python 3.7.2,如果你想要 python 2.7.x,请使用python2.
Install-Package python我偶然发现了一个名为OneGet或PackageMagement的PowerShell模块。
您可以执行以下操作:
PowerShell GetPackageSource
PowerShell Find-Package Python3
PowerShell Install-Package Python3
Run Code Online (Sandbox Code Playgroud)
您可以绕过交互并自动执行包下载和安装,例如:
PowerShell Install-Package -Scope CurrentUser -Force Python3
Run Code Online (Sandbox Code Playgroud)
我仍在弄清楚它,不确定它到底有多好用。