sharepoint - Getting exception while calling ApplyWebConfigModifications for encoded url's as value -


I'm trying to update the web. Using the powershell script for SharePoint web application using Codeig.

  $ Public WebApp = Get-SPWebApplication http: // my_website $ NewMod = new Object Microsoft.SharePoint.Administration.SPWebConfigModification $ NewMod.name = "[@ key = 'STSSignInURL']" $ NewMod.path = "/ configuration Add / AppSettings" $ NewMod.value = "& lt; add key = 'STSSignInURL' value = 'https: // mydomain: 443 / v2 / wsfederation? wa = wsignin1.0 & amp; wtrealm = http% 3a% 2f% 2ffra1fv- Na% 2f '/ & gt; "$ NewMod.owner =" owner "$ NewMod.sequence = 0 $ NewMod.type = Microsoft.SharePoint.Administration.SPWebConfigModification + SPWebConfigModificationType] :: EnsureChildNode $ public WebApp.WebConfigModifications.Add ($ NewMod) $ PublicWebApp.Update () $ PublicWebApp Kpripentveb Confif Modification ()  

but me up Prahlad find:

"0" logic (exception Caller "apply Krenconfig editing" with arguments): "=" is an unexpected token.

The value I am setting is a http encoded URL, and I am facing this problem with the encoded URL. The code is working fine for other plain text. Is there any alternative solution for this?

Whether the name of the modem should be something like this:

$ NewMod .name = "[@ key = 'STSSignInURL'] [@value] = 'https: // mydomain: 443 / V Add 2 / wsfederation = wsignin1.0 and wtrealm = http% 3 A% 2F% 2ffra1fv-na% 2f '] "

Comments