Skip to content

Get AcmaConstantValue

Ryan Newington edited this page Sep 4, 2025 · 5 revisions

Get-AcmaConstantValue

Description

Retrieves the value of a named constant from the ACMA database. Constants are global values that can be referenced in business rules and constructors throughout the ACMA configuration.

Syntax

Get-AcmaConstantValue -Name <string>

Parameters

Name (String)

The name of the constant to retrieve

  • Required: Yes
  • Position: Named
  • Pipeline input: No
  • Accepts: String representing the constant name

Return Type

Returns the value of the constant as an object (typically String, but can be other types)

Examples

Get a mail domain constant

$mailSuffix = Get-AcmaConstantValue -Name "mailSuffix"
Write-Output "Mail suffix is: $mailSuffix"

Use constant value in operations

$domain = Get-AcmaConstantValue -Name "defaultDomain"
$fullEmail = "$username@$domain"

Check if constant exists (error handling)

try {
    $value = Get-AcmaConstantValue -Name "optionalConstant"
    Write-Output "Constant value: $value"
} catch {
    Write-Warning "Constant 'optionalConstant' does not exist"
}

Clone this wiki locally