ExportVariables

<< Click to Display Table of Contents >>

ExportVariables

Exports custom variable definitions to a single XML file. This enables synchronization of variables between isolated networks, version control of variable configurations, and infrastructure-as-code workflows.

This command operates on custom variables only. System variables are read-only and are not included in the export.

Requires an Enterprise license.

Syntax

PDQInventory ExportVariables -Path <outputPath> [-Overwrite]

PDQInventory ExportVariables -Name <variableName> -Path <outputPath> [-Overwrite]

PDQInventory ExportVariables -Name <var1>,<var2>,... -Path <outputPath> [-Overwrite]

Parameters

Parameter

Required

Description

-Name

No

One or more custom variable names to export. Use commas to separate multiple names. Supports wildcard patterns (* and ?). Omit to export all custom variables.

-Path

Yes

Output file path or directory. If a directory is supplied, the file is written as Variables.xml within that directory. If a file path is supplied, that path is used as-is. All matched variables are written to a single file.

-Overwrite

No

Overwrite the output file if it already exists. Without this flag, the command exits with an error if the file already exists.

Exit Codes

Exit Code

Meaning

0

Export succeeded.

1

One or more variables failed to export, or one or more named variables were not found.

3

No variables found matching the specified name(s).

4

The output file already exists. Use -Overwrite to replace it.

Examples

Export all custom variables to a directory (writes Variables.xml):

PDQInventory ExportVariables -Path C:\Exports

Export all custom variables to a specific file:

PDQInventory ExportVariables -Path C:\Exports\Variables.xml

Export a single named variable:

PDQInventory ExportVariables -Name "BuildServer" -Path C:\Exports\Variables.xml

Export all variables whose names match a wildcard pattern:

PDQInventory ExportVariables -Name "Build*" -Path C:\Exports

Export multiple named variables, overwriting any existing file:

PDQInventory ExportVariables -Name "Var1","Var2" -Path C:\Exports -Overwrite

 

 

 

© 2026 PDQ.com Corporation. All rights reserved.

PDQ.com is a trademark of PDQ.com Corporation. All other product and company names are the property of their respective owners.

Help Version: 20.1.14.0