[英]Setting a website's application pool in IIS using Powershell
我需要一个Powershell命令,它相当于在IIS中添加一个网站,但是需要“应用程序池”的绑定:
到目前为止,我可以添加一个网站:
New-Item iis:\Sites\swmarket -bindings @{protocol="http";bindingInformation="80:swmarket"} -physicalPath c:\inetpub\wwwroot
但我不知道如何在新网站中设置“应用程序池”。 有什么方法可以看到所有的绑定吗?
Set-ItemProperty iis:\Sites\swmarket -Name applicationpool -Value swmarket
或者,使用Powershell 3,您可以这样做:
New-WebAppPool -Name $WebSiteName
New-Website -Name $WebSiteName -ApplicationPool $WebSiteName -HostHeader $WebSiteName -PhysicalPath $PathInfo -Port 80
Set-Content $PathInfo\default.htm “PSCreated Default Page”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.