PackageDeployment Module Help

Package Deployment Module (DSM eScript Commands)

Read-XmlNode Cmdlet

Version 1.0.0.3

Read-XmlNode

Synopsis

Get variable from XML file

Syntax

Read-XmlNode [-NodeType] <String> [-Path] <String> [-XPathQuery] <String> [-ContinueOnError] [-Wow64] [[-Attribute] <String>] [[-Index] <Int32>] [-ResultVariable] <String> [[-IndexVariable] <String>] [[-HintPath] <String>] [[-Context] <String>] [<CommonParameters>]

Description

Use this command to read information from existing XML files. In the dialog box you can specify the information you want to read from a specific XML file (Element, Attribute, Contents). If there are several matches for the part of the XML file you want to read, you can use an index to specify the match exactly.

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.

Required

False

Position

3

Accepts pipeline input

False

-Context <String>

User: Execution under user account; logging in HKEY_CURRENT_USER, i.e. for the user.
UserPerService: User-related command, execution with DSM Runtime Service.
Computer: Execution under user account; logging in HKEY_CURRENT_MACHINE, i.e. for the computer.
Computer: Execution with DSM Runtime Service; logging in HKEY_LOCAL_MACHINE, i.e. for the computer.

Required

False

Position

8

Accepts pipeline input

False

-ContinueOnError <SwitchParameter>

Continues script execution in spite of errors in the respective command

Required

False

Position

Named

Accepts pipeline input

False

-HintPath <String>

#TODO#

Required

False

Position

7

Accepts pipeline input

False

-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.

Required

False

Position

4

Accepts pipeline input

False

-IndexVariable <String>

Specifies the variable where you want to store the index of the used match without %. You can use this variable to determine the maximum value for the query loop. In this case we recommend that you enter the Read-XmlNode command several times in the eScript: first, to determine the maximum index and second to read the individual values in a corresponding loop.

Required

False

Position

6

Accepts pipeline input

False

-NodeType <String>

Select the type of the part of the XML file you want to read:
Element - Basic structural unit of an XML file that usually has a tag at the beginning and the end.
If you search for an element, the result variable contains the complete element with beginning and end tag and the complete contents between the tags. Searching for an element returns the complete element, for example: <Object type="STRING">QueenMary</Object>.
Attribute of an element
If you search for an attribute, the result variable returns the value of the attribute. Searching for the attribute type in the above example element results in: STRING.
Contents of an element
If you search for the contents, the result variable contains the complete text contents of the searched element between the beginning and the end tag. This does not include subelements with their text contents. Searching for the contents in the above example element results in: QueenMary.

Required

True

Position

0

Accepts pipeline input

False

-Path <String>

Path and name of the XML file you want to read. If not specified, the extension .XML is used automatically.

Required

True

Position

1

Accepts pipeline input

False

-ResultVariable <String>

Specifies the variable where you want to store the results of the command without %.

Required

True

Position

5

Accepts pipeline input

False

-Wow64 <SwitchParameter>

For reasons of compatibilty, Ivanti DSM maps file and registry access to the default storage location for 32 bit applications (provided that the storage location differs from that of 64-bit applications). File access: whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64. Registry commands: when accessing HKEY_LOCAL_MACHINE\SOFTWARE the calls are redirected to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node. The x64-switch stops this redirection of file and registry accesses when running the script command on a x64 computer; the eScript command runs on the specified path. CallScript command: the script runs in a 64-bit process.

Required

False

Position

Named

Accepts pipeline input

False

-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.

Required

True

Position

2

Accepts pipeline input

False

<CommonParameters>

For more information about common parameters, type "Get-Help about_CommonParameters".