title: How can you change an IIS Site's App Pool with the Powershell Web Admin Commandlets
body: <p>The following code demonstrates what I thought might work, but it doesn't change the app pool - it remains set at its current value (even though the $site object does update):</p>
  
  <pre><code>import-module WebAdministration
  
  $site = get-item "IIS:\Sites\Project"
  $site.ApplicationPool = "ProjectAppPool"
  $site | set-item
  </code></pre>
  
  <p>If you create the site with New-WebSite specifying the -ApplicationPool parameter, it creates as expected.  What Powershell IIS web command must I use to change an <em>existing</em> site's app pool to something different?</p>