This is my web.config file and content.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
This is my power shell script to remove everything from the tag ...
(Get-Content C:\Temp\web.config) |
Foreach-Object {$_ -replace '<dependentAssembly>[\s\S]*?<\/dependentAssembly>', ''} |
Set-Content C:\Temp\web.config
Script is running but its not removing anything. Can anyone please help me in this. What the mistake i am making in above code.
Expected output:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
</assemblyBinding>
</runtime>