All Questions
Tagged with powershell xml
2,139
questions
1
vote
2
answers
66
views
Modify OuterXml of a given node to keep it in file, but render node useless
I'm working on modifying xml files from an existing system using PowerShell. Our system supports using multiple nodes in one body, and depending on what the OuterXML is set as, it will bypass that ...
0
votes
1
answer
55
views
Rename a file based on value present in the name value in the content
I have a XML file as below and the file name is "data.xml"
<ns0:LovData xmlns:ns0="http://teamcenter.com/Schemas/Soa/2011-06/MetaModel">
<ns0:lovs name="infolist"...
1
vote
0
answers
31
views
How to use App.xaml when rendering WPF GUI in PowerShell core?
I want to use resource dictionary and app context to render a WPF GUI in PowerShell core (7.5) and .NET 9.
here is the main.xml
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/...
1
vote
1
answer
30
views
Powershell parse xml nodes and childnodes
My xml is something like this
<parent>
<somethingIamNotInterestedin>
....
</somethingIamNotInterestedin>
<body>
<event>
<eventid>1234</...
1
vote
1
answer
44
views
Using PowerShell to Select Value from Disjoined Inner XML Namespace
I am working with an XML document that has disjoined nested namespaces. Using a Powershell script, I need to loop through the XML nodes and select a value from each of the inner namespaces.
The ...
0
votes
0
answers
33
views
Weird issues with passing an XML file using Get-Content into Get-WinEvent
Having a weird issue (if I could event call it that). Not very well versed in Powershell/C#. I've tried looking up this problem with no luck. Here is a short script:
CD C:\Windows\System32
Get-...
1
vote
1
answer
47
views
Editing XML Values In PowerShell
This one gets me every time, and it seems each time I do it, it's a slightly different scenario so looking back at my old stuff isn't helping me make it work. I have an XML file formatted as
<...
-1
votes
3
answers
71
views
How to replace a specific word in XML file with batch file [closed]
I want to change the value 8888 of $SERVER_PORT in below XML file.
server.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software ...
0
votes
0
answers
59
views
Edit XML File In PowerShell And Save as UTF8 Without BOM
Alright, I'm trying to piecemeal instructions that I've found online, and I'm struggling... I have an XML file that is saved as UTF8. My objective is to create a backup (which I'm having no problem ...
3
votes
2
answers
66
views
Powershell creating up to 50k xml files ends up in memory leak
I have to loop through a csv file which contains up to 58k lines. Each line has 60 semicolon delimited values.
For each line I have to create one xml file. My script is doing what I expect it should ...
0
votes
0
answers
42
views
PowerShell, Commands are processing out of order [duplicate]
In this code, the order of actions is clearly defined, save the xml, then "before", then sleep 3, then "after". Most of this code is not relevant but here to demonstrate the way ...
0
votes
1
answer
38
views
Powershell - XML rename node name based upon child node value
I need to rename the name of a parent node based upon the value of a child node.
So far, this is what I have:
$path = 'C:\temp\test.xml'
$xml = [xml](Get-Content -Path $path)
$paramnode = $xml....
0
votes
1
answer
30
views
XmlElement .HasChildElement
Given XML of
<Element>Text</Element>
and
<Element>
<Child>Text</Child>
</Element>
Is there an easy way to differentiate the one that has a Child Element vs ...
0
votes
0
answers
119
views
in windows 10 and windows 11 I need to Configure a wifi profile from powershell and RCJA.xml file
I need to configure a network wifi connection with certain configuration parameters from a powershell script, and I imagine that I have to load and .xml profile with the details of the configuration, ...
0
votes
0
answers
39
views
Get root Xml of provided XmlElement to facilitate .ImportNode()
I have a function that accepts an [xmlNode] $testElement and an [xmlNode] $seedElement from a different XmlDocument. Under certain conditions I want to replace the $testElement with the $seedElement. ...