共用方式為


PackageManagement Module

本主題會顯示套件管理 Cmdlet 的說明主題。 此站臺上的 Cmdlet 參考文件記載了模組的最新版本。

本文件涵蓋 PackageManagement 模組 1.4.8.1 版。

這很重要

Windows PowerShell 5.1 隨附預安裝 PackageManagement 1.0.0.1 版。 此版本的 PowerShellGet 具有有限的功能,且不支援 PowerShell 資源庫的更新功能。 若要支援,您必須更新為最新版本。

這很重要

PackageManagement 模組中包含的命令與 Visual Studio 套件管理員控制台中 NuGet 模組所提供的命令不同。 每個模組都有其他模組中無法使用的命令。 具有相同名稱的命令會在其特定自變數中有所不同。 如需詳細資訊,請參閱Visual Studio套件管理員主控台的 PowerShell參考 檔。

PackageManagement Cmdlet

指令程式 Description
Find-Package

Finds software packages in available package sources.

Find-PackageProvider

Returns a list of Package Management package providers available for installation.

Get-Package

Returns a list of all software packages that were installed with PackageManagement.

Get-PackageProvider

Returns a list of package providers that are connected to Package Management.

Get-PackageSource

Gets a list of package sources that are registered for a package provider.

Import-PackageProvider

Adds Package Management package providers to the current session.

Install-Package

Installs one or more software packages.

Install-PackageProvider

Installs one or more Package Management package providers.

Register-PackageSource

Adds a package source for a specified package provider.

Save-Package

Saves packages to the local computer without installing them.

Set-PackageSource

Replaces a package source for a specified package provider.

Uninstall-Package

Uninstalls one or more software packages.

Unregister-PackageSource

Removes a registered package source.