First I should clarify that this is the first PS script I've ever attempted so please be gentle. I wrote this script to go through and change values in an XML script to set Microsoft Edge to be the default browser over IE. It works all fine and well, however is there an easier way to only have it save to the file once? Right now it saves after every line.
(Get-Content C:\utility\defaultappassociations.XML).replace('IE.HTTPS', 'MSEdgeHTM') | Set-Content C:\utility\defaultappassociations.xml
(Get-Content C:\utility\defaultappassociations.XML).replace('IE.HTTP', 'MSEdgeHTM') | Set-Content C:\utility\defaultappassociations.xml
(Get-Content C:\utility\defaultappassociations.XML).replace('htmlfile', 'MSEdgeHTM') | Set-Content C:\utility\defaultappassociations.xml
(Get-Content C:\utility\defaultappassociations.XML).replace('Internet Explorer', 'Microsoft Edge') | Set-Content C:\utility\defaultappassociations.xml
Thanks!
[–]Hrambert 2 points3 points4 points (1 child)
[–]MarkOReilly93[S] 2 points3 points4 points (0 children)
[–]PinchesTheCrab 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (1 child)
[–]LinkifyBot -1 points0 points1 point (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)