FileAliases.

ExpandEnvironmentVariables(ICakeContext, FilePath) Method

Summary

Expands all environment variables in the provided FilePath.
Namespace
Cake.Common.IO
Containing Type
FileAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Path")]
public static FilePath ExpandEnvironmentVariables(this ICakeContext context, FilePath filePath)

Examples

var path = new FilePath("%APPDATA%/foo.bar");
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.
filePath FilePath The path.

Return Value

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