title: Changing the physical path of an IIS website on a remote machine via Powershell
body: <p>I'm currently working on a deployment script that will take my site, export it from svn, remove any testing files etc in it, minify the javascript/css, copy the code to a remote web server, and then switch the physical path of the existing site to the new directory.</p>
  
  <p>So far I have everything working except for switching the physical directory in IIS.</p>
  
  <pre><code>$IIsServer = Get-WmiObject Site -Namespace "root/WebAdministration" -ComputerName $serverIP -Credential $credentials -Authentication PacketPrivacy
  $site = $IIsServer | Where-Object {$_.Name -eq $siteName}
  </code></pre>
  
  <p>When I look into the values I have I cant find the physical path property.</p>
  
  <p>Any suggestions would be greatly appreciated.</p>