/build/static/layout/Breadcrumb_cap_w.png

Powershell Help to edit XML file

New at this, and would like some help to edit a .xml file with Powershell. The XML file is located locally on a workstation. I'm trying to change the AuthenticationType to "Kerberos"  Everything I've tried runs with no errors but does not change the value. Any help would be greatly appreciated.

nzx4IAAAAABJRU5ErkJggg==



0 Comments   [ + ] Show comments

Answers (1)

Posted by: rileyz 4 years ago
Red Belt
1

Bang.

Its not the best code I have written, but also not the worst - but most importantly it does what says on the tin ✌

$XML = "C:\Media\Test.txt"
$XMLContent = Get-Content "C:\Media\Test.txt"
Rename-Item -Path $XML -NewName ($XML + '.Backup')
$XMLContent = $XMLContent -replace 'authenticationType="Basic"','authenticationType="Kerberos"'
$XMLContent | Out-File $XML
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ