Creating Variables
Creating Variables
Creating new Variables is accomplished via the cmdlet New-EmdbVariable. When using this cmdlet, besides the (internal) name of the Variable, at least specifying the Variable-Group, in which the new Variable will be created, is mandatory.
Examples:
Hint: The execution of these examples requires a connected PowerShell drive. |
The following example creates a new Variable "InternalID" in the Variable-Group "InternalData" (which was created in the example of chapter Creating Variable-Groups):
New-EmdbVariable "InternalID" -Group "InternalData" |
By specifying the parameter DisplayName, the display name of the new Variable can be set. The following example therefore creates a Variable with the internal identifier "InternalID" but sets the name displayed in the console to "Internal ID-Number":
New-EmdbVariable "InternalID" -Group "InternalData" -DisplayName "Internal ID-Number" |
If you are working in an international environment, the display names for the different languages supported by DSM 2014.1 can be specified. To achieve this, you supply a hash-table as the value of the DisplayName-switch, where each element consists of the combination <culturecode>=<displayname> and the elements are separated by semicolons.
New-EmdbVariable "InternalID" -Group "InternalData" -DisplayName @{de="Interne ID-Nummer";en="Internal ID-Number"} |
Furthermore, via the switches IsEncrypted and AvailableOnClient, it can be configured, if the Variable should be an encrypted password variable and if it is available on the managed Clients for use in scripts.
Note: Note that Variables are not part of the context rootDSE and therefore they can be referenced without a full qualified path resp. an absolute path. |