getglobal
Description
Prints a named global variable from the current PDMShell session. Omit -name to print all globals, ordered by name without regard to case. This command does not change any values or query PDM data card variables.
Syntax
getglobal [-name variableName]
Parameters
| Parameter | Alias | Required | Description |
|---|---|---|---|
-name |
No | Name of the variable to print. Names are case-insensitive. Omit this parameter to list all session globals. |
Examples
Read one variable
setglobal -name Project -value "ABC-100"
getglobal -name Project
Output from getglobal:
Project = ABC-100
List all variables
setglobal -name Project -value "ABC-100"
setglobal -name ReportFolder -value "C:\Reports"
getglobal
The command prints one name = value line for each variable in the current session.
Missing values and errors
- If no globals are set,
getglobalprintsNo global variables are set. - If a valid name is not set, it prints
Global variable Name is not set.This is informational, not a command error. - A supplied name must start with a letter or underscore and contain only letters, numbers, and underscores. Invalid names produce a command error.
Remarks
Globals are temporary and belong to the current session, not the vault. To use a value inside another command, write ${global.Name}; getglobal is for inspecting values in command output. Output can expose the stored values, so globals should not contain secrets.
Related commands
setglobal: create or replace a session global.clearglobal: remove one session global.getvar: read a PDM data card variable.- Global Variables overview.