Test-XmlNode
PackageDeployment Module Help |
Package Deployment Module |
Test-XmlNode Cmdlet |
Version 4.0.0.5 |
Test-XmlNode
Synopsis
The value exists in an XML file
Syntax
Test-XmlNode [-NodeType] <String> [-Path] <String> [-XPathQuery] <String> [-ContinueOnError] [-Wow64] [[-Attribute] <String>] [[-Index] <Int32>] [[-Content] <String>] [[-HintPath] <String>] [[-Context] <String>] [<CommonParameters>]
Description
Checks if a value exists in a specific XML file. Apart from specifying the actual XML file, you also have to specify which entry you want to check in the XML file. For this reason, specify the entry type and an XPath query. This query works like the Read-XmlNode command. In addition, you must specify the search string. The wildcards * and ? can be used. If you leave the field empty, the system checks for empty contents.
Parameters
-Attribute <String> |
||||||
This entry provides the name of the queried attribute if you select Entry type = Attribute. You are allowed to use the * wild card. |
||||||
|
-Content <String> |
||||||
Specifies the XML contents (for the actions Add and Change) that will be replaced and/or added to the XML file. You can use variables. |
||||||
|
-Context <String> |
||||||
User: Execution under user account; logging in HKEY_CURRENT_USER, i.e. for the user. |
||||||
|
-ContinueOnError <SwitchParameter> |
||||||
Continues script execution in spite of errors in the respective command |
||||||
|
-HintPath <String> |
||||||
#TODO# |
||||||
|
-Index <Int32> |
||||||
The index determines which element is to be read if the query finds several matches in the XML file. The following options are available: First match(default), Last match, Specific Index. Specify the location of the specific element on the match list, for example 3 for the third incidence in the XML file. |
||||||
|
-NodeType <String> |
||||||
Select the type of the part of the XML file you want to read: |
||||||
|
-Path <String> |
||||||
Path and name of the XML file you want to read. If not specified, the extension .XML is used automatically. |
||||||
|
-Wow64 <SwitchParameter> |
||||||
By default, the PackageDeployment module assumes to run in a 64-bit PowerShell process on 64-bit systems, and therefore defaults to the 64-bit application location (if different from the 32-bit application location) for file and registry accesses. If you want to access the 32-bit counterparts (in the file system %WinDir%\SysWOW64 instead of %WinDir%\System32, in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node instead of HKEY_LOCAL_MACHINE\SOFTWARE), use the -Wow64 switch. |
||||||
|
-XPathQuery <String> |
||||||
Used to identify the part of the XML file you want to read with the help of the XPath syntax. XPath query example: //Sample/node1/node2/Object[@type="STRING"]. In this example, the system queries the Object element in Sample/node1/node2 to which the type="STRING" applies. In most cases, the system finds several elements that match the query; therefore, specify an Index in addition. |
||||||
|
<CommonParameters> |
For more information about common parameters, type "Get-Help about_CommonParameters". |