Reputation: 4736
I am trying to rename (or even remove) iisstart.htm. I have tried the below but it is not doing anything. The result does not change anything:
Set-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.webServer/defaultDocument/files/add[@value="iisstart.htm"]' -Name 'value' -Value (@{value="REMOVE_iisstart.htm"})
I used to be able to do this via appcmd: set config /section:system.webServer/defaultDocument /-files.[value='iisstart.htm']
Any idea what is going wrong here?
Getting the info back I am using this and it shows nothing as changed when I set a hash table for value=REMOVE_iisstart.htm
Get-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.webServer/defaultDocument/files/add' -Name 'value'
Upvotes: 0
Views: 1620
Reputation: 66
I know this is an old post but i thought i would answer the second piece of this question how to remove the iisstart.htm file entirely with powershell.
Remove-WebConfigurationProperty 'system.webServer/defaultDocument' -Name files.collection -AtElement @{value="iisstart.htm"}
Upvotes: 0
Reputation: 268
Change your command just a bit - This command will rename the field
Set-WebConfigurationProperty 'system.webServer/defaultDocument/files/add[@value="iisstart.htm"]' -PSPath 'Machine/WebRoot/AppHost' -Name value -value "Remove_iisstart.htm"
Upvotes: 1