我想通过 Visual Studio 中的包管理器控制台运行 Clean、Build 和 Rebuild 命令,但到目前为止我还没有找到方法。
以下命令让我获得了解决方案中的第一个项目:
$project = Get-Project | select -First 1
当我运行时,我可以看到item$project | Get-Member
的成员。$project
#Members of the $project ($project | Get-Member)
# TypeName: System.__ComObject#{866311e6-c887-4143-9833-645f5b93f6f1}
#
#Name MemberType Definition
#---- ---------- ----------
#ProjectName CodeProperty System.String ProjectName{get=GetCustomUniqueName;}
#Delete Method void Delete ()
#Save Method void Save (string)
#SaveAs Method void SaveAs (string)
#Extender ParameterizedProperty IDispatch Extender (string) {get}
#CodeModel Property CodeModel CodeModel () {get}
#Collection Property Projects Collection () {get}
#ConfigurationManager Property ConfigurationManager ConfigurationManager () {get}
#DTE Property DTE DTE () {get}
#ExtenderCATID Property string ExtenderCATID () {get}
#ExtenderNames Property Variant ExtenderNames () {get}
#FileName Property string FileName () {get}
#FullName Property string FullName () {get}
#Globals Property Globals Globals () {get}
#IsDirty Property bool IsDirty () {get} {set}
#Kind Property string Kind () {get}
#Name Property string Name () {get} {set}
#Object Property IDispatch Object () {get}
#ParentProjectItem Property ProjectItem ParentProjectItem () {get}
#ProjectItems Property ProjectItems ProjectItems () {get}
#Properties Property Properties Properties () {get}
#Saved Property bool Saved () {get} {set}
#UniqueName Property string UniqueName () {get}
#Type ScriptProperty System.Object Type {get=switch ($this.Kind) {...
我不确定我是否可以通过该$project
项目进入 Clean Build 和 Rebuild 方法,或者我是否应该通过定位项目路径直接运行 msbuild。
任何的想法?