我试图从centralBinaryLogFile配置文件中删除applicationHost元素:
我将使用下面的内容来删除以下内容:
Remove-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.applicationHost/log' -Name 'centralBinaryLogFile'但是,每当每次我尝试用以下方法删除它时,它都会发出抱怨:
**WARNING: Property centralBinaryLogFile is not found on /system.applicationHost/log.**我知道它是存在的,就好像我运行了下面的代码一样,我可以很好地得到这个元素:
Get-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.applicationHost/log' -Name 'centralBinaryLogFile'
enabled : True
directory : %SystemDrive%\inetpub\logs\LogFiles
period : Daily
truncateSize : 20971520
localTimeRollover : False
ItemXPath : /system.applicationHost/log
Attributes : {enabled, directory, period, truncateSize...}
ChildElements : {}
ElementTagName : centralBinaryLogFile
Methods :
Schema : Microsoft.IIs.PowerShell.Framework.ConfigurationElementSchema我还尝试使用下面的方法,认为哈希表可能会起作用,但是它抱怨名称不是集合。
Remove-WebconfigurationProperty -Filter "system.applicationHost/log" "Machine/WebRoot/AppHost" -Name centralBinaryLogFile -AtElement @{ElementTagName="centralBinaryLogFile"}能帮我把这个拿掉吗?
发布于 2016-01-04 23:21:14
我尝试了同样的事情,也得到了同样的行为。我知道这不是在移除它,但是禁用就够了吗?
Set-WebConfiguration -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.applicationHost/log/centralBinaryLogFile' -value @{enabled=$false}发布于 2016-01-05 14:41:41
如果其他人被困在spin...do中,而head不使用webconfigurationproperty属性,而是使用webconfigurationproperty:
Clear-WebConfiguration -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.applicationHost/log/centralBinaryLogFile' https://stackoverflow.com/questions/34600984
复制相似问题