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.
So far I have everything working except for switching the physical directory in IIS.
$IIsServer = Get-WmiObject Site -Namespace "root/WebAdministration" -ComputerName $serverIP -Credential $credentials -Authentication PacketPrivacy
$site = $IIsServer | Where-Object {$_.Name -eq $siteName}
When I look into the values I have I cant find the physical path property.
Any suggestions would be greatly appreciated.
This also works:
PS IIS:\Sites> Set-ItemProperty IIS:\Sites\Staging `
-name physicalPath `
-value "C:\blah\Web"
(Note the use of backticks for line continuations)