CakeHostsAliases Class

Summary

Functionalty to operate hosts-file. Requres admin permissions and will probably fail on your general CI server.

Mostly aimed on automation scripts rather than actual project builds.

Install via:
#addin "nuget:?package=Cake.Hosts"
Assembly
Cake.Hosts.dll
Namespace
Cake.Hosts
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["CakeHostsAliases"] class Type type-node

Syntax

public static class CakeHostsAliases

Attributes

Type Description
CakeNamespaceImportAttribute
CakeAliasCategoryAttribute

Methods

Name Value Summary
AddHostsRecord(ICakeContext, string, string) void
Appends a record to the end of hosts file. If this value already exist, no modifications applied
static
HostsRecordExists(ICakeContext, string, string) bool
Checks if a record already exists in hosts file
static
RemoveHostsRecord(ICakeContext, string, string) void
Removes a line with given IP address and domain name. If given pair does not exist in hosts file, no modifications applied
static

Extension Methods

Name Value Summary
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Requires the Cake.Issues addin