Get-Project(Visual Studio 中的包管理器控制台)

仅在适用于 Windows 的 Visual Studio 中的包管理器控制台内可用。

显示有关默认项目或指定项目的信息。 Get-Project 会具体返回对项目的 Visual Studio DTE(开发工具环境)对象的引用。

语法

Get-Project [[-Name] <string>] [-All] [<CommonParameters>]

参数设置

参数 说明
Name 指定要显示的项目,默认为在包管理器控制台中选择的默认项目。 -Name 开关自身为可选。
全部 为解决方案中的每个项目显示信息;项目的顺序不确定。

这些参数均不接受管道输入或通配符字符。

通用参数

Get-Project 支持以下常见 PowerShell 参数:Debug、Error Action、ErrorVariable、OutBuffer、OutVariable、PipelineVariable、Verbose、WarningAction 和 WarningVariable。

示例

# Displays information for the default project
Get-Project

# Displays information for a project in the solution
Get-Project MyProjectName

    # Displays information for all projects in the solution
Get-Project -All