DirectoryAliases.

ExpandEnvironmentVariables(ICakeContext, DirectoryPath) Method

Summary

Expands all environment variables in the provided DirectoryPath.
Namespace
Cake.Common.IO
Containing Type
DirectoryAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Path")]
public static DirectoryPath ExpandEnvironmentVariables(this ICakeContext context, DirectoryPath directoryPath)

Examples

var path = new DirectoryPath("%APPDATA%/foo");
var expanded = path.ExpandEnvironmentVariables(environment);

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeAliasCategoryAttribute An attribute used for documentation of alias methods/properties.

Parameters

Name Type Description
context ICakeContext The context.
directoryPath DirectoryPath The path.

Return Value

Type Description
DirectoryPath A new DirectoryPath with each environment variable replaced by its value.