我試圖從applicationHost配置文件刪除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"}
任何想法我怎麼刪除此嗎?
你忽略了的代碼示例如何試圖將其刪除。 – dugas
是的 - 對不起,現在添加它。我也在問題的底部嘗試了另一條線 - 既不是我目前不幸的那樣做。 – lara400