Add Nodes and Values to the sharepoint web.config file using powershell
hi ,
i add following text sharepoint web.config file using power shell.
i have tried of forum,however couldnt able find exact information
please me on this
above /system.webserver line add text::
<httpprotocol>
<customheaders>
<clear />
<add name="x-ua-compatible" value="ie=11" />
<add name="x-frame-options" value="sameorigin" />
</customheaders>
</httpprotocol>
</system.webserver>
regards,
bashaibm
hi jrv,
thank reply.
i new powershell.if possible please provide me entire script add text?
the text add under </system.webserver>
regards,
bashaibm
that not node spec closing tag node(element)
you need to say element parent.
you need use createdocumentf4agment create xml , use appendchild.
$f=$config.createdocumentfragment() $f.innerxml=@' <httpprotocol> <customheaders> <clear /> <add name="x-ua-compatible" value="ie=11" /> <add name="x-frame-options" value="sameorigin" /> </customheaders> </httpprotocol> '@ $config.configuration.appendchild($f)
if element name exists corrupt config file.
\_(ツ)_/
Windows Server > Windows PowerShell
Comments
Post a Comment