title: Running the Clean, Build and Rebuild through the Package Manager Console
body: <p>I want to run the Clean, Build and Rebuild commands through the Package Manager Console in Visual Studio but so far I haven't been able to find how.</p>
  
  <p>The following command gets me the first project inside the solution:</p>
  
  <pre><code>$project = Get-Project | select -First 1
  </code></pre>
  
  <p>When I run the <code>$project | Get-Member</code>, I can see the members of <code>$project</code> item.</p>
  
  <pre><code>#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) {...       
  </code></pre>
  
  <p>I am not sure if I can get to the Clean Build and Rebuild method through the <code>$project</code> item or if I should I directly run the msbuild by targeting the project path.</p>
  
  <p>Any idea?</p>