0
0
PowershellHow-ToBeginner · 2 min read

PowerShell Script to Parse XML File Easily

Use [xml]$xml = Get-Content 'file.xml' to load the XML file, then access nodes like $xml.Root.Element to parse and read data.
📋

Examples

Input<root><name>John</name></root>
OutputJohn
Input<books><book><title>Book1</title></book><book><title>Book2</title></book></books>
OutputBook1 Book2
Input<data><item id='1'>A</item><item id='2'>B</item></data>
OutputA B
🧠

How to Think About It

First, read the XML file content into a variable and convert it to an XML object using [xml]. Then, navigate the XML structure by accessing elements and attributes as properties to extract the needed data.
📐

Algorithm

1
Read the XML file content into a string variable.
2
Convert the string to an XML object using the XML type accelerator.
3
Access the desired XML elements or attributes using dot notation.
4
Output or process the extracted data as needed.
💻

Code

powershell
[xml]$xml = Get-Content 'sample.xml'
foreach ($book in $xml.books.book) {
    Write-Output $book.title
}
Output
Book1 Book2
🔍

Dry Run

Let's trace parsing a sample XML with two book titles through the code

1

Load XML content

[xml]$xml = Get-Content 'sample.xml' loads XML with books and titles

2

Loop through book elements

foreach loops over $xml.books.book which contains two book nodes

3

Output each title

Write-Output prints each book.title: 'Book1' then 'Book2'

IterationCurrent Book Title
1Book1
2Book2
💡

Why This Works

Step 1: Load XML as object

Using [xml] converts the file content into an XML object, enabling easy property access.

Step 2: Access elements by name

XML nodes become properties, so $xml.books.book accesses all elements.

Step 3: Iterate and output

Looping through nodes lets you extract and print each value simply.</p></div></div></div></div><div class="qna-section"><div class="qna-section-header"><div class="qna-section-icon alternatives">🔄</div><h2 class="qna-section-title">Alternative Approaches</h2></div><div class="qna-section-body"><div class="qna-alternatives"><div class="qna-alt-item"><div class="qna-alt-header"><span class="qna-alt-method">Using Select-Xml cmdlet</span></div><div class="qna-alt-body"><div class="qna-code-block"><div class="qna-code-header"><span class="qna-code-lang">powershell</span><button class="qna-code-copy" title="Copy code"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"></rect><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"></path></svg></button></div><pre class="qna-code-content">$xmlContent = Get-Content <span class="hl-str">'sample.xml'</span> $nodes = Select-Xml -Xml $xmlContent -XPath <span class="hl-str">'//book/title'</span> foreach ($node in $nodes) { Write-Output $node.Node.InnerText }</pre></div></div><div class="qna-alt-note">Select-Xml uses XPath queries, which is powerful for complex XML but slightly more complex syntax.</div></div><div class="qna-alt-item"><div class="qna-alt-header"><span class="qna-alt-method">Using XMLDocument COM object</span></div><div class="qna-alt-body"><div class="qna-code-block"><div class="qna-code-header"><span class="qna-code-lang">powershell</span><button class="qna-code-copy" title="Copy code"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"></rect><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"></path></svg></button></div><pre class="qna-code-content">$xmlDoc = New-Object -ComObject <span class="hl-str">'Microsoft.XMLDOM'</span> $xmlDoc.Load(<span class="hl-str">'sample.xml'</span>) $nodes = $xmlDoc.SelectNodes(<span class="hl-str">'//book/title'</span>) foreach ($node in $nodes) { Write-Output $node.text }</pre></div></div><div class="qna-alt-note">This older COM method works but is less idiomatic and slower than native PowerShell XML parsing.</div></div></div></div></div><div class="qna-section"><div class="qna-section-header"><div class="qna-section-icon complexity">⚡</div><h2 class="qna-section-title">Complexity: <!-- -->O(n)<!-- --> time, <!-- -->O(n)<!-- --> space</h2></div><div class="qna-section-body"><div style="margin-bottom:0.85rem"><h4 style="font-weight:700;font-size:0.92rem;color:#0f0f0f;margin-bottom:0.3rem">Time Complexity</h4><p class="qna-rich-text">Parsing the XML file and iterating over its nodes takes time proportional to the number of nodes, so O(n).</p></div><div style="margin-bottom:0.85rem"><h4 style="font-weight:700;font-size:0.92rem;color:#0f0f0f;margin-bottom:0.3rem">Space Complexity</h4><p class="qna-rich-text">The XML object holds the entire file in memory, so space usage grows with file size, O(n).</p></div><div style="margin-bottom:0.85rem"><h4 style="font-weight:700;font-size:0.92rem;color:#0f0f0f;margin-bottom:0.3rem">Which Approach is Fastest?</h4><p class="qna-rich-text">Casting to [xml] is fast and simple for most cases; Select-Xml adds XPath flexibility but with slight overhead; COM object is slower and less recommended.</p></div><div class="qna-table-wrap"><table class="qna-table"><thead><tr><th>Approach</th><th>Time</th><th>Space</th><th>Best For</th></tr></thead><tbody><tr><td>[xml] casting</td><td>O(n)</td><td>O(n)</td><td>Simple and direct XML parsing</td></tr><tr><td>Select-Xml cmdlet</td><td>O(n)</td><td>O(n)</td><td>XPath queries on XML content</td></tr><tr><td>COM XMLDocument</td><td>O(n)</td><td>O(n)</td><td>Legacy support, complex XML</td></tr></tbody></table></div></div></div><div class="qna-inline-card tip"><div class="qna-inline-card-icon">💡</div><span>Always cast the file content to [xml] to work with XML data easily in PowerShell.</span></div><div class="qna-inline-card mistake"><div class="qna-inline-card-icon">⚠️</div><span>Forgetting to cast the file content to [xml] causes the data to be treated as plain text, not XML.</span></div><hr class="light-hr-border mt-5 mb-0"/><div class="qna-related-mesh"><div class="qna-mesh-block"><p class="qna-mesh-label">Related by keyword</p><div class="qna-mesh-list"><a href="/codefly/learn/powershell/qna/how-to-find-file-in-powershell" class="qna-mesh-item token-match"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">How to Find a File in PowerShell Quickly and Easily</span><span class="qna-mesh-item-tag muted">File Operations</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/how-to-rename-file-in-powershell" class="qna-mesh-item token-match"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">How to Rename a File in PowerShell Quickly and Easily</span><span class="qna-mesh-item-tag muted">File Operations</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/how-to-use-out-file-powershell" class="qna-mesh-item token-match"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">How to Use Out-File in PowerShell: Save Output to Files Easily</span><span class="qna-mesh-item-tag muted">File Operations</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/powershell-script-to-swap-two-numbers" class="qna-mesh-item token-match"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script to Swap Two Numbers Easily</span><span class="qna-mesh-item-tag muted">PowerShell Number Programs</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/powershell-script-to-extract-substring" class="qna-mesh-item token-match"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script to Extract Substring Easily</span><span class="qna-mesh-item-tag muted">PowerShell String Programs</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="blue-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a></div></div><div class="qna-mesh-block"><p class="qna-mesh-label">Up next</p><div class="qna-mesh-list"><a href="/codefly/learn/powershell/qna/powershell-script-for-linear-search" class="qna-mesh-item neighbor"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="green-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script for Linear Search with Example and Explanation</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="green-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/powershell-script-for-selection-sort" class="qna-mesh-item neighbor"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="green-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script for Selection Sort Algorithm</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="green-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/powershell-script-to-check-cpu-usage" class="qna-mesh-item neighbor"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="green-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script to Check CPU Usage Easily</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="green-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/powershell-script-to-check-disk-space" class="qna-mesh-item neighbor"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="green-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script to Check Disk Space Usage</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="green-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a></div></div><div class="qna-mesh-block same-topic-block"><p class="qna-mesh-label">More in <strong>PowerShell File Programs</strong></p><div class="qna-mesh-list"><a href="/codefly/learn/powershell/qna/powershell-script-to-backup-files" class="qna-mesh-item same-topic"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="purple-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script to Backup Files Easily</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="purple-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/powershell-script-to-compress-files" class="qna-mesh-item same-topic"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="purple-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script to Compress Files Quickly</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="purple-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/powershell-script-to-convert-csv-to-json" class="qna-mesh-item same-topic"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="purple-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script to Convert CSV to JSON Easily</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="purple-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a><a href="/codefly/learn/powershell/qna/powershell-script-to-convert-json-to-csv" class="qna-mesh-item same-topic"><span class="qna-mesh-item-icon"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="purple-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg></span><span class="qna-mesh-item-title">PowerShell Script to Convert JSON to CSV Easily</span><span class="qna-mesh-item-arrow"><svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" class="purple-icon-color" height="18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></span></a></div></div></div></article></div></div></div></main></div></div> <script src="/_next/static/chunks/webpack-fd24bd8e19d2841a.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/b133bdac07c7940e.css\",\"style\"]\n2:HL[\"/_next/static/css/caf3ca742c7945f9.css\",\"style\"]\n3:HL[\"/_next/static/css/837a603cb1a59856.css\",\"style\"]\n4:HL[\"/_next/static/css/74cd1891d522f88c.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"5:I[95751,[],\"\"]\n8:I[39275,[],\"\"]\nc:I[61343,[],\"\"]\nd:I[84080,[\"8726\",\"static/chunks/8726-583188341cbc1496.js\",\"3185\",\"static/chunks/app/layout-7a1373330f6a4c98.js\"],\"\"]\ne:I[88726,[\"8726\",\"static/chunks/8726-583188341cbc1496.js\",\"3185\",\"static/chunks/app/layout-7a1373330f6a4c98.js\"],\"Toaster\"]\nf:I[20154,[\"8422\",\"static/chunks/66ec4792-a0fc378024be0c7b.js\",\"6648\",\"static/chunks/6648-fff0cf0e0a1f8d25.js\",\"9160\",\"static/chunks/app/not-found-c4181ddc3e64e5f3.js\"],\"default\"]\n10:I[70548,[\"8726\",\"static/chunks/8726-583188341cbc1496.js\",\"3185\",\"static/chunks/app/layout-7a1373330f6a4c98.js\"],\"default\"]\n12:I[76130,[],\"\"]\n9:[\"lang\",\"en\",\"d\"]\na:[\"subject\",\"powershell\",\"d\"]\nb:[\"slug\",\"powershell-script-to-parse-xml-file\",\"d\"]\n13:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b133bdac07c7940e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L5\",null,{\"buildId\":\"hN8t5By7h5nzsrdSose07\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/en/codefly/learn/powershell/qna/powershell-script-to-parse-xml-file\",\"initialTree\":[\"\",{\"children\":[[\"lang\",\"en\",\"d\"],{\"children\":[\"codefly\",{\"children\":[\"learn\",{\"children\":[[\"subject\",\"powershell\",\"d\"],{\"children\":[\"qna\",{\"children\":[[\"slug\",\"powershell-script-to-parse-xml-file\",\"d\"],{\"children\":[\"__PAGE__\",{}]}]}]}]}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[[\"lang\",\"en\",\"d\"],{\"children\":[\"codefly\",{\"children\":[\"learn\",{\"children\":[[\"subject\",\"powershell\",\"d\"],{\"children\":[\"qna\",{\"children\":[[\"slug\",\"powershell-script-to-parse-xml-file\",\"d\"],{\"children\":[\"__PAGE__\",{},[[\"$L6\",\"$L7\"],null],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$a\",\"children\",\"qna\",\"children\",\"$b\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/caf3ca742c7945f9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/837a603cb1a59856.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/74cd1891d522f88c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$a\",\"children\",\"qna\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\",\"$a\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\",\"learn\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\",\"codefly\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"$9\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"name\":\"theme-color\",\"content\":\"#5f56fe\"}],[\"$\",\"meta\",null,{\"name\":\"msapplication-TileColor\",\"content\":\"#5f56fe\"}],[\"$\",\"$Ld\",null,{\"src\":\"https://www.googletagmanager.com/gtag/js?id=G-N2NY2DMMDW\",\"strategy\":\"afterInteractive\"}],[\"$\",\"$Ld\",null,{\"id\":\"google-analytics\",\"strategy\":\"afterInteractive\",\"children\":\"\\n window.dataLayer = window.dataLayer || [];\\n function gtag(){dataLayer.push(arguments);}\\n gtag('js', new Date());\\n gtag('config', 'G-N2NY2DMMDW', {\\n page_path: window.location.pathname,\\n });\\n \"}],[\"$\",\"script\",null,{\"async\":true,\"src\":\"https://www.googletagmanager.com/gtag/js?id=AW-17928224938\"}],[\"$\",\"$Ld\",null,{\"children\":\"\\n window.dataLayer = window.dataLayer || [];\\n function gtag() {\\n dataLayer.push(arguments);\\n }\\n gtag('js', new Date());\\n gtag('config', 'AW-17928224938');\\n \"}],[\"$\",\"script\",null,{\"data-grow-initializer\":\"\",\"suppressHydrationWarning\":true,\"dangerouslySetInnerHTML\":{\"__html\":\"!(function(){window.growMe||((window.growMe=function(e){window.growMe._.push(e);}),(window.growMe._=[]));var e=document.createElement(\\\"script\\\");(e.type=\\\"text/javascript\\\"),(e.src=\\\"https://faves.grow.me/main.js\\\"),(e.defer=!0),e.setAttribute(\\\"data-grow-faves-site-id\\\",\\\"U2l0ZTo0MGIxZDBlZC0wNzdlLTQ0NjgtOThmOC1kNDYyZGMwM2IwMWY=\\\");var t=document.getElementsByTagName(\\\"script\\\")[0];t.parentNode.insertBefore(e,t);})();\"}}],[\"$\",\"$Ld\",null,{\"src\":\"//scripts.scriptwrapper.com/tags/40b1d0ed-077e-4468-98f8-d462dc03b01f.js\",\"strategy\":\"afterInteractive\",\"data-noptimize\":\"1\",\"data-cfasync\":\"false\"}],[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"suppressHydrationWarning\":true,\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"WebApplication\\\",\\\"name\\\":\\\"Leyaa.ai\\\",\\\"description\\\":\\\"Leyaa.ai builds learning intelligence that understands how you learn - guiding what to study, how to practice, and when to move forward.\\\",\\\"url\\\":\\\"https://leyaa.ai\\\",\\\"applicationCategory\\\":\\\"EducationalApplication\\\",\\\"operatingSystem\\\":\\\"Web\\\",\\\"offers\\\":{\\\"@type\\\":\\\"Offer\\\",\\\"price\\\":\\\"0\\\",\\\"priceCurrency\\\":\\\"USD\\\"},\\\"creator\\\":{\\\"@type\\\":\\\"Organization\\\",\\\"name\\\":\\\"Leyaa.ai\\\"}}\"}}],[\"$\",\"link\",null,{\"href\":\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css\",\"rel\":\"stylesheet\",\"integrity\":\"sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"$Ld\",null,{\"id\":\"clarity-script\",\"strategy\":\"afterInteractive\",\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function(c,l,a,r,i,t,y){\\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\\n t=l.createElement(r);t.async=1;t.src=\\\"https://www.clarity.ms/tag/\\\"+i;\\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\\n })(window, document, \\\"clarity\\\", \\\"script\\\", \\\"w4gxh6rdmh\\\");\\n \"}}]]}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$Le\",null,{\"containerStyle\":{\"top\":70}}],[\"$\",\"div\",null,{\"className\":\"bg-grid\"}],[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[\"$\",\"$Lf\",null,{}],\"notFoundStyles\":[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/250d3fff07338fa3.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],\"styles\":null}],[\"$\",\"$L10\",null,{}],\" \"]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$L11\"],\"globalErrorComponent\":\"$12\",\"missingSlots\":\"$W13\"}]]\n"])</script><script>self.__next_f.push([1,"14:I[56620,[\"8422\",\"static/chunks/66ec4792-a0fc378024be0c7b.js\",\"6051\",\"static/chunks/795d4814-e558be540b48def1.js\",\"522\",\"static/chunks/94730671-fd9628eddbd5107b.js\",\"7240\",\"static/chunks/53c13509-506edbde2b5b3f55.js\",\"7699\",\"static/chunks/8e1d74a4-a085c2fbc868135a.js\",\"5706\",\"static/chunks/9c4e2130-11ecd4bfc78e4568.js\",\"9212\",\"static/chunks/59650de3-e90957e3c8f68e80.js\",\"9956\",\"static/chunks/ee560e2c-91d263129af6c0b1.js\",\"7627\",\"static/chunks/7627-224bb765a4decf1d.js\",\"7652\",\"static/chunks/7652-412e201fe52797ee.js\",\"8555\",\"static/chunks/8555-cc138b2fb472bbce.js\",\"6013\",\"static/chunks/app/%5Blang%5D/codefly/learn/%5Bsubject%5D/qna/%5Bslug%5D/page-16afe37dc81236b8.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"7:[[[\"$\",\"script\",\"0\",{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"BreadcrumbList\\\",\\\"itemListElement\\\":[{\\\"@type\\\":\\\"ListItem\\\",\\\"position\\\":1,\\\"name\\\":\\\"Home\\\",\\\"item\\\":\\\"https://leyaa.ai/\\\"},{\\\"@type\\\":\\\"ListItem\\\",\\\"position\\\":2,\\\"name\\\":\\\"PowerShell Script to Parse XML File Easily\\\"}]}\"}}],[\"$\",\"script\",\"1\",{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"TechArticle\\\",\\\"headline\\\":\\\"PowerShell Script to Parse XML File Easily\\\",\\\"description\\\":\\\"Learn how to write a PowerShell script to parse an XML file, extract data, and display it with examples, dry run, and explanation.\\\",\\\"author\\\":{\\\"@type\\\":\\\"Organization\\\",\\\"name\\\":\\\"Leyaa.ai\\\",\\\"url\\\":\\\"https://leyaa.ai\\\"},\\\"publisher\\\":{\\\"@type\\\":\\\"Organization\\\",\\\"name\\\":\\\"Leyaa.ai\\\",\\\"url\\\":\\\"https://leyaa.ai\\\"},\\\"url\\\":\\\"https://leyaa.ai/codefly/learn/powershell/qna/powershell-script-to-parse-xml-file\\\",\\\"inLanguage\\\":\\\"en\\\",\\\"proficiencyLevel\\\":\\\"beginner\\\",\\\"about\\\":{\\\"@type\\\":\\\"ComputerLanguage\\\",\\\"name\\\":\\\"Powershell\\\"},\\\"datePublished\\\":\\\"2026-03-09\\\",\\\"timeRequired\\\":\\\"PT2M\\\"}\"}}],[\"$\",\"script\",\"2\",{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"HowTo\\\",\\\"name\\\":\\\"PowerShell Script to Parse XML File Easily\\\",\\\"description\\\":\\\"Use [xml]$xml = Get-Content 'file.xml' to load the XML file, then access nodes like $xml.Root.Element to parse and read data.\\\",\\\"step\\\":[{\\\"@type\\\":\\\"HowToStep\\\",\\\"position\\\":1,\\\"text\\\":\\\"Read the XML file content into a string variable.\\\"},{\\\"@type\\\":\\\"HowToStep\\\",\\\"position\\\":2,\\\"text\\\":\\\"Convert the string to an XML object using the XML type accelerator.\\\"},{\\\"@type\\\":\\\"HowToStep\\\",\\\"position\\\":3,\\\"text\\\":\\\"Access the desired XML elements or attributes using dot notation.\\\"},{\\\"@type\\\":\\\"HowToStep\\\",\\\"position\\\":4,\\\"text\\\":\\\"Output or process the extracted data as needed.\\\"}],\\\"totalTime\\\":\\\"PT2M\\\"}\"}}]],[\"$\",\"$L14\",null,{\"data\":{\"subject\":\"powershell\",\"query_slug\":\"powershell-script-to-parse-xml-file\",\"algorithm\":[\"Read the XML file content into a string variable.\",\"Convert the string to an XML object using the XML type accelerator.\",\"Access the desired XML elements or attributes using dot notation.\",\"Output or process the extracted data as needed.\"],\"alternatives\":[{\"method\":\"Using Select-Xml cmdlet\",\"code\":\"$$xmlContent = Get-Content 'sample.xml'\\n$nodes = Select-Xml -Xml $xmlContent -XPath '//book/title'\\nforeach ($node in $nodes) {\\n Write-Output $node.Node.InnerText\\n}\",\"note\":\"Select-Xml uses XPath queries, which is powerful for complex XML but slightly more complex syntax.\"},{\"method\":\"Using XMLDocument COM object\",\"code\":\"$$xmlDoc = New-Object -ComObject 'Microsoft.XMLDOM'\\n$xmlDoc.Load('sample.xml')\\n$nodes = $xmlDoc.SelectNodes('//book/title')\\nforeach ($node in $nodes) {\\n Write-Output $node.text\\n}\",\"note\":\"This older COM method works but is less idiomatic and slower than native PowerShell XML parsing.\"}],\"code\":{\"language\":\"powershell\",\"snippet\":\"[xml]$xml = Get-Content 'sample.xml'\\nforeach ($book in $xml.books.book) {\\n Write-Output $book.title\\n}\",\"output\":\"Book1\\nBook2\"},\"common_mistake\":\"Forgetting to cast the file content to [xml] causes the data to be treated as plain text, not XML.\",\"complexity\":{\"time\":\"O(n)\",\"space\":\"O(n)\",\"analysis\":[{\"heading\":\"Time Complexity\",\"content\":\"Parsing the XML file and iterating over its nodes takes time proportional to the number of nodes, so O(n).\"},{\"heading\":\"Space Complexity\",\"content\":\"The XML object holds the entire file in memory, so space usage grows with file size, O(n).\"},{\"heading\":\"Which Approach is Fastest?\",\"content\":\"Casting to [xml] is fast and simple for most cases; Select-Xml adds XPath flexibility but with slight overhead; COM object is slower and less recommended.\"}],\"comparison_table\":{\"headers\":[\"Approach\",\"Time\",\"Space\",\"Best For\"],\"rows\":[[\"[xml] casting\",\"O(n)\",\"O(n)\",\"Simple and direct XML parsing\"],[\"Select-Xml cmdlet\",\"O(n)\",\"O(n)\",\"XPath queries on XML content\"],[\"COM XMLDocument\",\"O(n)\",\"O(n)\",\"Legacy support, complex XML\"]]}},\"content_type\":\"Scripting \u0026 Automation\",\"direct_answer\":\"Use \u003ccode\u003e[xml]$xml = Get-Content 'file.xml'\u003c/code\u003e to load the XML file, then access nodes like \u003ccode\u003e$xml.Root.Element\u003c/code\u003e to parse and read data.\",\"dry_run\":{\"description\":\"Let's trace parsing a sample XML with two book titles through the code\",\"steps\":[{\"step\":1,\"title\":\"Load XML content\",\"content\":\"[xml]$xml = Get-Content 'sample.xml' loads XML with books and titles\"},{\"step\":2,\"title\":\"Loop through book elements\",\"content\":\"foreach loops over $xml.books.book which contains two book nodes\"},{\"step\":3,\"title\":\"Output each title\",\"content\":\"Write-Output prints each book.title: 'Book1' then 'Book2'\"}],\"trace_table\":{\"headers\":[\"Iteration\",\"Current Book Title\"],\"rows\":[[\"1\",\"Book1\"],[\"2\",\"Book2\"]]}},\"examples\":[{\"input\":\"\u003croot\u003e\u003cname\u003eJohn\u003c/name\u003e\u003c/root\u003e\",\"output\":\"John\"},{\"input\":\"\u003cbooks\u003e\u003cbook\u003e\u003ctitle\u003eBook1\u003c/title\u003e\u003c/book\u003e\u003cbook\u003e\u003ctitle\u003eBook2\u003c/title\u003e\u003c/book\u003e\u003c/books\u003e\",\"output\":\"Book1\\nBook2\"},{\"input\":\"\u003cdata\u003e\u003citem id='1'\u003eA\u003c/item\u003e\u003citem id='2'\u003eB\u003c/item\u003e\u003c/data\u003e\",\"output\":\"A\\nB\"}],\"explanation\":[{\"step\":1,\"title\":\"Load XML as object\",\"content\":\"Using \u003ccode\u003e[xml]\u003c/code\u003e converts the file content into an XML object, enabling easy property access.\"},{\"step\":2,\"title\":\"Access elements by name\",\"content\":\"XML nodes become properties, so \u003ccode\u003e$xml.books.book\u003c/code\u003e accesses all \u003cbook\u003e elements.\"},{\"step\":3,\"title\":\"Iterate and output\",\"content\":\"Looping through nodes lets you extract and print each \u003ctitle\u003e value simply.\"}],\"logic_design\":\"First, read the XML file content into a variable and convert it to an XML object using \u003ccode\u003e[xml]\u003c/code\u003e. Then, navigate the XML structure by accessing elements and attributes as properties to extract the needed data.\",\"metadata\":{\"version\":\"1.0\",\"mode\":\"QNA\",\"estimated_read_time\":2,\"difficulty\":\"beginner\"},\"pattern_slug\":\"powershell-script-to-parse-xml-file\",\"query\":\"PowerShell script to parse xml file\",\"query_type\":\"how_to\",\"quick_tip\":\"Always cast the file content to [xml] to work with XML data easily in PowerShell.\",\"related_queries\":[\"powershell-read-xml-file\",\"powershell-select-xml-example\",\"powershell-parse-xml-attributes\"],\"seo_description\":\"Learn how to write a PowerShell script to parse an XML file, extract data, and display it with examples, dry run, and explanation.\",\"seo_title\":\"PowerShell Script to Parse XML File Easily\",\"topic_group\":\"PowerShell File Programs\",\"topic_order\":14,\"publishedAt\":\"2026-03-09\"},\"subject\":\"powershell\",\"dbSubject\":\"powershell\",\"product\":\"codefly\",\"baseUrl\":\"/codefly/learn\",\"queryList\":[{\"topic\":\"Getting Started\",\"order\":1,\"count\":8,\"queries\":[{\"slug\":\"how-to-install-powershell\",\"title\":\"How to Install PowerShell: Step-by-Step Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-open-powershell\",\"title\":\"How to Open PowerShell Quickly and Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-5-vs-powershell-7\",\"title\":\"PowerShell 5 vs PowerShell 7: Key Differences and When to Use Each\",\"type\":\"comparison\"},{\"slug\":\"powershell-vs-bash-difference\",\"title\":\"PowerShell vs Bash: Key Differences and When to Use Each\",\"type\":\"comparison\"},{\"slug\":\"powershell-vs-cmd-difference\",\"title\":\"PowerShell vs cmd: Key Differences and When to Use Each\",\"type\":\"comparison\"},{\"slug\":\"what-is-powershell\",\"title\":\"What is PowerShell: Overview, Usage, and Examples\",\"type\":\"what_is\"},{\"slug\":\"what-is-powershell-core\",\"title\":\"What is PowerShell Core: Overview and Usage\",\"type\":\"what_is\"},{\"slug\":\"what-is-powershell-used-for\",\"title\":\"What is PowerShell Used For: Key Uses and Examples\",\"type\":\"what_is\"}]},{\"topic\":\"Basics\",\"order\":2,\"count\":16,\"queries\":[{\"slug\":\"how-to-create-variable-in-powershell\",\"title\":\"How to Create Variable in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-cmdlet-in-powershell\",\"title\":\"How to Use Cmdlet in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-format-list-powershell\",\"title\":\"How to Use Format-List in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-format-table-powershell\",\"title\":\"How to Use Format-Table in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-command-in-powershell\",\"title\":\"How to Use Get-Command in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-help-in-powershell\",\"title\":\"How to Use Get-Help in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-member-powershell\",\"title\":\"How to Use Get-Member in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-measure-object-powershell\",\"title\":\"How to Use Measure-Object in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-pipe-operator-powershell\",\"title\":\"How to Use Pipe Operator in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-pipeline-in-powershell\",\"title\":\"How to Use Pipeline in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-select-object-powershell\",\"title\":\"How to Use Select-Object in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-sort-object-powershell\",\"title\":\"How to Use Sort-Object in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-where-object-powershell\",\"title\":\"How to Use Where-Object in PowerShell: Filter Objects Easily\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-write-host-powershell\",\"title\":\"How to Use Write-Host in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-write-output-powershell\",\"title\":\"How to Use Write-Output in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"write-host-vs-write-output-in-powershell\",\"title\":\"Write-Host vs Write-Output in PowerShell: Key Differences and Usage\",\"type\":\"comparison\"}]},{\"topic\":\"File Operations\",\"order\":3,\"count\":19,\"queries\":[{\"slug\":\"how-to-copy-file-in-powershell\",\"title\":\"How to Copy File in PowerShell: Simple Commands and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-create-directory-powershell\",\"title\":\"How to Create Directory in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-create-file-in-powershell\",\"title\":\"How to Create a File in PowerShell: Simple Commands and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-delete-file-in-powershell\",\"title\":\"How to Delete a File in PowerShell Quickly and Safely\",\"type\":\"how_to\"},{\"slug\":\"how-to-find-file-in-powershell\",\"title\":\"How to Find a File in PowerShell Quickly and Easily\",\"type\":\"how_to\"},{\"slug\":\"how-to-list-files-in-powershell\",\"title\":\"How to List Files in PowerShell: Simple Commands and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-move-file-in-powershell\",\"title\":\"How to Move File in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-read-file-in-powershell\",\"title\":\"How to Read a File in PowerShell: Simple Commands and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-rename-file-in-powershell\",\"title\":\"How to Rename a File in PowerShell Quickly and Easily\",\"type\":\"how_to\"},{\"slug\":\"how-to-search-in-file-powershell\",\"title\":\"How to Search in a File Using PowerShell Quickly\",\"type\":\"how_to\"},{\"slug\":\"how-to-test-if-file-exists-powershell\",\"title\":\"How to Test If a File Exists in PowerShell\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-add-content-powershell\",\"title\":\"How to Use Add-Content in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-childitem-powershell\",\"title\":\"How to Use Get-ChildItem in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-content-powershell\",\"title\":\"How to Use Get-Content in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-out-file-powershell\",\"title\":\"How to Use Out-File in PowerShell: Save Output to Files Easily\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-select-string-powershell\",\"title\":\"How to Use Select-String in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-set-content-powershell\",\"title\":\"How to Use Set-Content in PowerShell: Write Text to Files\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-test-path-powershell\",\"title\":\"How to Use Test-Path in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-write-to-file-powershell\",\"title\":\"How to Write to a File in PowerShell: Simple Guide\",\"type\":\"how_to\"}]},{\"topic\":\"Scripting\",\"order\":4,\"count\":21,\"queries\":[{\"slug\":\"how-to-create-powershell-script\",\"title\":\"How to Create a PowerShell Script: Simple Steps for Beginners\",\"type\":\"how_to\"},{\"slug\":\"how-to-handle-errors-powershell\",\"title\":\"How to Handle Errors in PowerShell Scripts Effectively\",\"type\":\"debug_fix\"},{\"slug\":\"how-to-run-powershell-script\",\"title\":\"How to Run PowerShell Script: Simple Steps and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-set-execution-policy-powershell\",\"title\":\"How to Set Execution Policy in PowerShell: Simple Steps\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-array-in-powershell\",\"title\":\"How to Use Array in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-date-in-powershell\",\"title\":\"How to Use Date in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-do-while-powershell\",\"title\":\"How to Use Do While Loop in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-execution-policy-powershell\",\"title\":\"How to Use Execution Policy in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-for-loop-in-powershell\",\"title\":\"How to Use For Loop in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-foreach-in-powershell\",\"title\":\"How to Use foreach in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-function-in-powershell\",\"title\":\"How to Use Functions in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-date-powershell\",\"title\":\"How to Use Get-Date in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-hashtable-in-powershell\",\"title\":\"How to Use Hashtable in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-if-else-in-powershell\",\"title\":\"How to Use If Else in PowerShell: Simple Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-parameter-in-function-in-powershell\",\"title\":\"How to Use Parameters in PowerShell Functions Easily\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-regex-in-powershell\",\"title\":\"How to Use Regex in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-string-operations-powershell\",\"title\":\"How to Use String Operations in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-switch-in-powershell\",\"title\":\"How to Use Switch in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-try-catch-powershell\",\"title\":\"How to Use Try Catch in PowerShell for Error Handling\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-while-loop-powershell\",\"title\":\"How to Use While Loop in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"what-is-execution-policy-in-powershell\",\"title\":\"What is Execution Policy in PowerShell: Simple Explanation and Usage\",\"type\":\"what_is\"}]},{\"topic\":\"System Administration\",\"order\":5,\"count\":18,\"queries\":[{\"slug\":\"how-to-get-event-log-powershell\",\"title\":\"How to Get Event Log in PowerShell: Simple Commands\",\"type\":\"how_to\"},{\"slug\":\"how-to-get-process-in-powershell\",\"title\":\"How to Get Process in PowerShell: Simple Commands and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-get-service-in-powershell\",\"title\":\"How to Get Service in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-install-module-powershell\",\"title\":\"How to Install a Module in PowerShell Quickly and Easily\",\"type\":\"how_to\"},{\"slug\":\"how-to-manage-user-accounts-powershell\",\"title\":\"How to Manage User Accounts with PowerShell Commands\",\"type\":\"how_to\"},{\"slug\":\"how-to-manage-windows-registry-powershell\",\"title\":\"How to Manage Windows Registry with PowerShell\",\"type\":\"how_to\"},{\"slug\":\"how-to-restart-service-powershell\",\"title\":\"How to Restart a Service Using PowerShell Quickly\",\"type\":\"how_to\"},{\"slug\":\"how-to-start-service-powershell\",\"title\":\"How to Start a Service in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-stop-process-powershell\",\"title\":\"How to Stop a Process in PowerShell Quickly and Safely\",\"type\":\"how_to\"},{\"slug\":\"how-to-stop-service-powershell\",\"title\":\"How to Stop a Service Using PowerShell Quickly\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-enter-pssession-in-powershell\",\"title\":\"How to Use Enter-PSSession in PowerShell for Remote Sessions\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-ciminstance-powershell\",\"title\":\"How to Use Get-CimInstance in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-process-powershell\",\"title\":\"How to Use Get-Process in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-wmiobject-powershell\",\"title\":\"How to Use Get-WmiObject in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-import-module-powershell\",\"title\":\"How to Use Import-Module in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-install-module-powershell\",\"title\":\"How to Use Install-Module in PowerShell: Simple Guide\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-invoke-command-powershell\",\"title\":\"How to Use Invoke-Command in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-remote-powershell\",\"title\":\"How to Use Remote PowerShell: Syntax and Examples\",\"type\":\"how_to\"}]},{\"topic\":\"Active Directory\",\"order\":6,\"count\":11,\"queries\":[{\"slug\":\"how-to-add-user-to-ad-group-powershell\",\"title\":\"How to Add User to AD Group with PowerShell\",\"type\":\"how_to\"},{\"slug\":\"how-to-create-ad-user-powershell\",\"title\":\"How to Create an AD User with PowerShell Quickly\",\"type\":\"how_to\"},{\"slug\":\"how-to-disable-ad-account-powershell\",\"title\":\"How to Disable an Active Directory Account Using PowerShell\",\"type\":\"how_to\"},{\"slug\":\"how-to-get-ad-computer-powershell\",\"title\":\"How to Get AD Computer Information Using PowerShell\",\"type\":\"how_to\"},{\"slug\":\"how-to-get-ad-group-powershell\",\"title\":\"How to Get Active Directory Group with PowerShell\",\"type\":\"how_to\"},{\"slug\":\"how-to-get-ad-user-powershell\",\"title\":\"How to Get AD User in PowerShell: Simple Commands and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-import-ad-module-powershell\",\"title\":\"How to Import AD Module in PowerShell Quickly\",\"type\":\"how_to\"},{\"slug\":\"how-to-reset-ad-password-powershell\",\"title\":\"How to Reset Active Directory Password Using PowerShell\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-get-aduser-in-powershell\",\"title\":\"How to Use Get-ADUser in PowerShell: Syntax and Examples\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-new-aduser-in-powershell\",\"title\":\"How to Use New-ADUser in PowerShell: Create Active Directory Users\",\"type\":\"how_to\"},{\"slug\":\"how-to-use-powershell-with-active-directory\",\"title\":\"How to Use PowerShell with Active Directory: Simple Guide\",\"type\":\"how_to\"}]},{\"topic\":\"Common Errors\",\"order\":7,\"count\":5,\"queries\":[{\"slug\":\"how-to-fix-access-denied-powershell\",\"title\":\"How to Fix Access Denied Error in PowerShell Quickly\",\"type\":\"debug_fix\"},{\"slug\":\"how-to-fix-command-not-found-powershell\",\"title\":\"How to Fix 'Command Not Found' Error in PowerShell\",\"type\":\"debug_fix\"},{\"slug\":\"how-to-fix-execution-policy-error-powershell\",\"title\":\"How to Fix Execution Policy Error in PowerShell Quickly\",\"type\":\"debug_fix\"},{\"slug\":\"how-to-fix-module-not-found-powershell\",\"title\":\"How to Fix 'Module Not Found' Error in PowerShell\",\"type\":\"debug_fix\"},{\"slug\":\"how-to-fix-remote-session-error-powershell\",\"title\":\"How to Fix Remote Session Error in PowerShell Quickly\",\"type\":\"debug_fix\"}]},{\"topic\":\"PowerShell vs Other\",\"order\":8,\"count\":4,\"queries\":[{\"slug\":\"powershell-vs-bash\",\"title\":\"PowerShell vs Bash: Key Differences and When to Use Each\",\"type\":\"comparison\"},{\"slug\":\"powershell-vs-cmd\",\"title\":\"PowerShell vs cmd: Key Differences and When to Use Each\",\"type\":\"comparison\"},{\"slug\":\"powershell-vs-python\",\"title\":\"PowerShell vs Python: Key Differences and When to Use Each\",\"type\":\"comparison\"},{\"slug\":\"when-to-use-powershell-vs-bash\",\"title\":\"PowerShell vs Bash: Key Differences and When to Use Each\",\"type\":\"comparison\"}]},{\"topic\":\"PowerShell Number Programs\",\"order\":9,\"count\":20,\"queries\":[{\"slug\":\"powershell-script-to-add-two-numbers\",\"title\":\"PowerShell Script to Add Two Numbers with Output\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-armstrong-number\",\"title\":\"PowerShell Script to Check Armstrong Number\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-even-or-odd\",\"title\":\"PowerShell Script to Check Even or Odd Number\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-leap-year\",\"title\":\"PowerShell Script to Check Leap Year\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-palindrome-number\",\"title\":\"PowerShell Script to Check Palindrome Number\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-prime-number\",\"title\":\"PowerShell Script to Check Prime Number with Output\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-convert-decimal-to-binary\",\"title\":\"PowerShell Script to Convert Decimal to Binary Number\",\"type\":\"convert\"},{\"slug\":\"powershell-script-to-count-digits-in-number\",\"title\":\"PowerShell Script to Count Digits in a Number\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-create-simple-calculator\",\"title\":\"PowerShell Script to Create Simple Calculator\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-area-of-circle\",\"title\":\"PowerShell Script to Find Area of Circle\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-factorial\",\"title\":\"PowerShell Script to Find Factorial of a Number\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-hcf-of-two-numbers\",\"title\":\"PowerShell Script to Find HCF of Two Numbers\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-largest-of-three-numbers\",\"title\":\"PowerShell Script to Find Largest of Three Numbers\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-lcm-of-two-numbers\",\"title\":\"PowerShell Script to Find LCM of Two Numbers\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-sum-of-digits\",\"title\":\"PowerShell Script to Find Sum of Digits\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-sum-of-n-numbers\",\"title\":\"PowerShell Script to Find Sum of n Numbers\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-print-fibonacci-series\",\"title\":\"PowerShell Script to Print Fibonacci Series\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-print-multiplication-table\",\"title\":\"PowerShell Script to Print Multiplication Table\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-reverse-a-number\",\"title\":\"PowerShell Script to Reverse a Number with Output Example\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-swap-two-numbers\",\"title\":\"PowerShell Script to Swap Two Numbers Easily\",\"type\":\"how_to\"}]},{\"topic\":\"PowerShell String Programs\",\"order\":10,\"count\":13,\"queries\":[{\"slug\":\"powershell-script-to-capitalize-first-letter\",\"title\":\"PowerShell Script to Capitalize First Letter of a String\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-if-string-contains-substring\",\"title\":\"PowerShell Script to Check if String Contains Substring\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-palindrome-string\",\"title\":\"PowerShell Script to Check Palindrome String\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-convert-to-lowercase\",\"title\":\"PowerShell Script to Convert Text to Lowercase\",\"type\":\"convert\"},{\"slug\":\"powershell-script-to-convert-to-uppercase\",\"title\":\"PowerShell Script to Convert Text to Uppercase\",\"type\":\"convert\"},{\"slug\":\"powershell-script-to-count-vowels-in-string\",\"title\":\"PowerShell Script to Count Vowels in a String\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-count-words-in-string\",\"title\":\"PowerShell Script to Count Words in a String\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-extract-substring\",\"title\":\"PowerShell Script to Extract Substring Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-length-of-string\",\"title\":\"PowerShell Script to Find Length of String\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-remove-spaces-from-string\",\"title\":\"PowerShell Script to Remove Spaces from String\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-replace-character-in-string\",\"title\":\"PowerShell Script to Replace Character in String\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-reverse-a-string\",\"title\":\"PowerShell Script to Reverse a String Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-split-string-by-delimiter\",\"title\":\"PowerShell Script to Split String by Delimiter\",\"type\":\"how_to\"}]},{\"topic\":\"PowerShell Array Programs\",\"order\":11,\"count\":10,\"queries\":[{\"slug\":\"powershell-script-to-count-elements-in-array\",\"title\":\"PowerShell Script to Count Elements in Array\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-average-of-array\",\"title\":\"PowerShell Script to Find Average of Array\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-largest-in-array\",\"title\":\"PowerShell Script to Find Largest Number in Array\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-smallest-in-array\",\"title\":\"PowerShell Script to Find Smallest Number in Array\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-sum-of-array\",\"title\":\"PowerShell Script to Find Sum of Array\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-merge-two-arrays\",\"title\":\"PowerShell Script to Merge Two Arrays Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-remove-duplicates-from-array\",\"title\":\"PowerShell Script to Remove Duplicates from Array\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-reverse-array\",\"title\":\"PowerShell Script to Reverse Array Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-search-element-in-array\",\"title\":\"PowerShell Script to Search Element in Array\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-sort-array\",\"title\":\"PowerShell Script to Sort Array Easily\",\"type\":\"how_to\"}]},{\"topic\":\"PowerShell Pattern Programs\",\"order\":12,\"count\":5,\"queries\":[{\"slug\":\"powershell-script-to-print-diamond-pattern\",\"title\":\"PowerShell Script to Print Diamond Pattern\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-print-number-pattern\",\"title\":\"PowerShell Script to Print Number Pattern Example\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-print-pyramid-pattern\",\"title\":\"PowerShell Script to Print Pyramid Pattern\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-print-right-triangle-pattern\",\"title\":\"PowerShell Script to Print Right Triangle Pattern\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-print-star-pattern\",\"title\":\"PowerShell Script to Print Star Pattern Example\",\"type\":\"how_to\"}]},{\"topic\":\"PowerShell Sorting Programs\",\"order\":13,\"count\":4,\"queries\":[{\"slug\":\"powershell-script-for-binary-search\",\"title\":\"PowerShell Script to Perform Binary Search on Sorted Array\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-for-bubble-sort\",\"title\":\"PowerShell Script for Bubble Sort - Simple Sorting Example\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-for-linear-search\",\"title\":\"PowerShell Script for Linear Search with Example and Explanation\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-for-selection-sort\",\"title\":\"PowerShell Script for Selection Sort Algorithm\",\"type\":\"how_to\"}]},{\"topic\":\"PowerShell File Programs\",\"order\":14,\"count\":19,\"queries\":[{\"slug\":\"powershell-script-to-backup-files\",\"title\":\"PowerShell Script to Backup Files Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-compress-files\",\"title\":\"PowerShell Script to Compress Files Quickly\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-convert-csv-to-json\",\"title\":\"PowerShell Script to Convert CSV to JSON Easily\",\"type\":\"convert\"},{\"slug\":\"powershell-script-to-convert-json-to-csv\",\"title\":\"PowerShell Script to Convert JSON to CSV Easily\",\"type\":\"convert\"},{\"slug\":\"powershell-script-to-count-lines-in-file\",\"title\":\"PowerShell Script to Count Lines in a File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-count-words-in-file\",\"title\":\"PowerShell Script to Count Words in a File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-delete-old-files\",\"title\":\"PowerShell Script to Delete Old Files Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-extract-column-from-csv\",\"title\":\"PowerShell Script to Extract Column from CSV File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-and-replace-in-file\",\"title\":\"PowerShell Script to Find and Replace Text in a File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-duplicate-lines-in-file\",\"title\":\"PowerShell Script to Find Duplicate Lines in File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-large-files\",\"title\":\"PowerShell Script to Find Large Files Quickly\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-merge-two-files\",\"title\":\"PowerShell Script to Merge Two Files Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-monitor-file-changes\",\"title\":\"PowerShell Script to Monitor File Changes Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-parse-xml-file\",\"title\":\"PowerShell Script to Parse XML File Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-read-excel-file\",\"title\":\"PowerShell Script to Read Excel File Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-remove-blank-lines-from-file\",\"title\":\"PowerShell Script to Remove Blank Lines from File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-rename-multiple-files\",\"title\":\"PowerShell Script to Rename Multiple Files Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-sort-lines-in-file\",\"title\":\"PowerShell Script to Sort Lines in a File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-write-excel-file\",\"title\":\"PowerShell Script to Write Excel File Easily\",\"type\":\"how_to\"}]},{\"topic\":\"PowerShell System Programs\",\"order\":15,\"count\":21,\"queries\":[{\"slug\":\"powershell-script-to-check-cpu-usage\",\"title\":\"PowerShell Script to Check CPU Usage Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-disk-space\",\"title\":\"PowerShell Script to Check Disk Space Usage\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-event-log\",\"title\":\"PowerShell Script to Check Event Log Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-if-port-is-open\",\"title\":\"PowerShell Script to Check if Port is Open\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-installed-software\",\"title\":\"PowerShell Script to Check Installed Software List\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-memory-usage\",\"title\":\"PowerShell Script to Check Memory Usage Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-check-windows-updates\",\"title\":\"PowerShell Script to Check Windows Updates Status\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-clean-temp-files\",\"title\":\"PowerShell Script to Clean Temp Files Quickly\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-create-user-account\",\"title\":\"PowerShell Script to Create User Account Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-disable-user-account\",\"title\":\"PowerShell Script to Disable User Account Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-export-to-html-report\",\"title\":\"PowerShell Script to Export Data to HTML Report\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-ip-address\",\"title\":\"PowerShell Script to Find IP Address Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-generate-system-report\",\"title\":\"PowerShell Script to Generate System Report Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-get-network-adapter-info\",\"title\":\"PowerShell Script to Get Network Adapter Info\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-monitor-service-status\",\"title\":\"PowerShell Script to Monitor Service Status Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-reset-password\",\"title\":\"PowerShell Script to Reset Password Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-restart-service\",\"title\":\"PowerShell Script to Restart a Service Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-schedule-task\",\"title\":\"PowerShell Script to Schedule a Task Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-send-email\",\"title\":\"PowerShell Script to Send Email with SMTP\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-test-network-connectivity\",\"title\":\"PowerShell Script to Test Network Connectivity Quickly\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-uninstall-software\",\"title\":\"PowerShell Script to Uninstall Software Easily\",\"type\":\"how_to\"}]},{\"topic\":\"PowerShell Active Directory Programs\",\"order\":16,\"count\":13,\"queries\":[{\"slug\":\"powershell-script-to-add-user-to-group\",\"title\":\"PowerShell Script to Add User to Group Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-create-bulk-users-from-csv\",\"title\":\"PowerShell Script to Create Bulk Users from CSV File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-export-ad-users-to-csv\",\"title\":\"PowerShell Script to Export AD Users to CSV File\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-find-inactive-ad-accounts\",\"title\":\"PowerShell Script to Find Inactive AD Accounts Quickly\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-get-all-ad-users\",\"title\":\"PowerShell Script to Get All AD Users Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-get-computer-objects-from-ad\",\"title\":\"PowerShell Script to Get Computer Objects from AD\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-get-disabled-ad-users\",\"title\":\"PowerShell Script to Get Disabled AD Users Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-get-expired-passwords\",\"title\":\"PowerShell Script to Get Expired Passwords Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-get-locked-out-users\",\"title\":\"PowerShell Script to Get Locked Out Users Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-get-user-last-login\",\"title\":\"PowerShell Script to Get User Last Login Date\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-get-users-in-group\",\"title\":\"PowerShell Script to Get Users in Group\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-remove-user-from-group\",\"title\":\"PowerShell Script to Remove User from Group Easily\",\"type\":\"how_to\"},{\"slug\":\"powershell-script-to-unlock-ad-account\",\"title\":\"PowerShell Script to Unlock AD Account Quickly\",\"type\":\"how_to\"}]}],\"activeSlug\":\"powershell-script-to-parse-xml-file\"}]]\n"])</script><script>self.__next_f.push([1,"11:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"PowerShell Script to Parse XML File Easily | Leyaa.ai\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Learn how to write a PowerShell script to parse an XML file, extract data, and display it with examples, dry run, and explanation.\"}],[\"$\",\"meta\",\"4\",{\"name\":\"author\",\"content\":\"Leyaa.ai\"}],[\"$\",\"link\",\"5\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"6\",{\"name\":\"keywords\",\"content\":\"learning intelligence,AI learning,personalized learning,adaptive learning,study guide,exam preparation,learning platform,education technology,edtech,smart learning\"}],[\"$\",\"meta\",\"7\",{\"name\":\"creator\",\"content\":\"Leyaa.ai\"}],[\"$\",\"meta\",\"8\",{\"name\":\"publisher\",\"content\":\"Leyaa.ai\"}],[\"$\",\"meta\",\"9\",{\"name\":\"robots\",\"content\":\"index, follow\"}],[\"$\",\"meta\",\"10\",{\"name\":\"googlebot\",\"content\":\"index, follow, max-image-preview:large, max-snippet:-1\"}],[\"$\",\"link\",\"11\",{\"rel\":\"canonical\",\"href\":\"https://leyaa.ai/codefly/learn/powershell/qna/powershell-script-to-parse-xml-file\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:title\",\"content\":\"PowerShell Script to Parse XML File Easily | Leyaa.ai\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:description\",\"content\":\"Learn how to write a PowerShell script to parse an XML file, extract data, and display it with examples, dry run, and explanation.\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:url\",\"content\":\"https://leyaa.ai/codefly/learn/powershell/qna/powershell-script-to-parse-xml-file\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:site_name\",\"content\":\"Leyaa.ai\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"article\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:title\",\"content\":\"PowerShell Script to Parse XML File Easily | Leyaa.ai\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:description\",\"content\":\"Learn how to write a PowerShell script to parse an XML file, extract data, and display it with examples, dry run, and explanation.\"}],[\"$\",\"link\",\"20\",{\"rel\":\"icon\",\"href\":\"/leyaa-logo.png\"}],[\"$\",\"link\",\"21\",{\"rel\":\"apple-touch-icon\",\"href\":\"/leyaa-logo.png\"}],[\"$\",\"meta\",\"22\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\n"])</script></body></html>