--- title: "Set-Variable" ---
This is generated from the built in components of Otter 2023.0, and may be different than what you have installed (especially if you have extensions); go to [Gear Icon] -> Administration -> Operations within your Otter instance to see exactly what operations are available.

Creates or assigns a configuration variable in Otter.

Script usage:

Otter::Set-Variable(
	[Credentials: <text>],
	Name: <text>,
	Value: <text>,
	[Server: <text>],
	[Role: <text>],
	[Environment: <text>],
	[Sensitive: <true/false>],
	[Host: <text>],
	[ApiKey: <SecureString>]
);

Arguments:

NameFormatScript UsageUsage Notes
Credentials
text
Credentials
Variable name
text
Name
This argument is required.
Value
text
Value
This argument is required.
Server name
text
Server
Role name
text
Role
Environment name
text
Environment
Sensitive
true/false
Sensitive
Otter server URL
text
Host
API key
SecureString
ApiKey

Note: If multiple entity scopes are provided, the variable will be multi-scoped. If no entity scope is provided, a global variable will be set.

Example:


# sets the variable for the hdars-web-1k-tokyo server to the name of the current application
Otter::Set-Variable
(
    Credentials: ProductionOtter,
    Server: hdars-web-1k-tokyo,
    Name: LatestDeployedApplication,
    Value: $ApplicationName,
    Sensitive: false
);