Created
July 1, 2014 22:40
-
-
Save bielawb/2cb86a8abd01bae47ada to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Select-Xml -Path .\Test.xml -XPath "//subNode[@Number > 1]" | | |
ForEach-Object { $_.Node } | |
Select-Xml -Path .\TestPage.xhtml -XPath "//*[contains(@id,'test')]" | | |
ForEach-Object { $_.Node } | |
$xpath = @' | |
//*[ | |
contains( | |
name(), | |
'Password' | |
) or | |
contains( | |
text(), | |
'contoso' | |
) | |
] | |
'@ | |
Select-Xml -Path .\ValueAndName.xml -XPath $xpath | | |
Format-Table -AutoSize Node, @{ | |
Name = 'Value' | |
Expression = { $_.Node.InnerXml } | |
} | |
Select-Xml -Path .\Test.xml -XPath "//subNode[not(@Number > 1)]" | | |
ForEach-Object { $_.Node } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<root> | |
<node Name="First"> | |
<subNode Number="1" /> | |
<subNode Number="2" /> | |
</node> | |
<node Name="Second" /> | |
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>Test Page</title> | |
</head> | |
<body> | |
<h1 id="title">This is first H1 directly under 'body'</h1> | |
<ol> | |
<li><h1>This is my h1 in list!</h1></li> | |
<li>This won't show up...</li> | |
</ol> | |
<h2>Header, but smaller...</h2> | |
<h3>Even smaller one.</h3> | |
<h6>Smallest?</h6> | |
<table> | |
<colgroup> | |
<col/> | |
<col/> | |
<col/> | |
</colgroup> | |
<tr> | |
<th id="testing">Test</th> | |
<th><h1>Another h1 in table header...</h1></th> | |
<th id="othertest">Another Test</th> | |
</tr> | |
<tr> | |
<td><h1>and h1 hidden in the table cell...</h1></td> | |
<td>Select-Xml-Test</td> | |
<td>Oops?</td> | |
</tr> | |
</table> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<root> | |
<configuration> | |
<local> | |
<localUser>Local</localUser> | |
<localPassword>P@ssw0rd</localPassword> | |
</local> | |
<domain> | |
<domainName>contoso.com</domainName> | |
<domainUser>Domain</domainUser> | |
<domainPassword>P@$$word</domainPassword> | |
</domain> | |
</configuration> | |
</root> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment