我需要在一些带有 powershell 的网站上设置 serviceAutoStartProvider 和 serviceAutostartEnabled 属性。
此 cmdlet 适用于具有 Web 应用程序的网站:
Set-ItemProperty IIS:\Sites\$websiteName\$webApplicationName -name serviceAutoStartEnabled -Value 'True'
对于没有 Web 应用程序的网站,我正在这样做
Set-ItemProperty IIS:\Sites\$websiteName -name serviceAutoStartEnabled -Value 'True'
但它不起作用,我收到了这个错误
未找到属性 serviceAutoStartEnabled
当我检查 IIS 的 applicationHost.config 文件时,每个网站都有一个默认的 web 应用程序,那么,如何在根站点上设置这些属性?
谢谢,