Otter Documentation

.net - Ensure AppSetting

  • Last Modified: 2019-07-30

This is generated from the built-in components of Otter 2.2, and may be different than what you have installed (especially if you have extensions); go to [User Icon] > Documentation within your Otter instance to see exactly what operations are available.

Ensure AppSetting

Ensures a .NET application configuration file has the specified appSetting key/value pair.

Operation type:

Ensuring - this operation will ensure a specified configuration exists on a remote server after comparing its current state to the desired state.

Script usage:

DotNet::Ensure-AppSetting(
	Key: <text>,
	File: <text>,
	Value: <text>,
	[AppSettingsXPath: <text>]
);

Arguments:

Name Format Script Usage Usage Notes
🔑 AppSetting key
text
Key
This argument is the unique key for this operation, which means it must uniquely identify the target of the operation. This argument is required.
Config file path
text
File
The file path of the configuration file, typically web.config or app.config. This argument is required.
AppSetting value
text
Value
This argument is required.
XPath for appSettings
text
AppSettingsXPath

Note: By default, the "appSettings" section must exist in the file under the "configuration" element in order to ensure the key/value pair is present. Use the AppSettingsXPath argument to select a different element instead.

Example:

# ensures that the application is configured to use test mode for the example third-party API
DotNet::Ensure-AppSetting(
	File: E:\Website\web.config,
	Key: Accounts.ThirdParty.PaymentApi,
	Value: https://test.example.com/api/v3
);

Is this documentation incorrect or incomplete? Help us by contributing!

This documentation is licensed under CC-BY-SA-4.0 and stored in GitHub.

Generated from commit ce197caa on master