Skip to content

Commit fcb8f53

Browse files
thomhurstclaude
andcommitted
docs: Add XML documentation to IEnvironmentVariables interface
Fixes #1522 Add comprehensive XML documentation to the IEnvironmentVariables interface: - Interface summary describing its purpose for reading/modifying environment variables - GetEnvironmentVariable: document name, target params and nullable return - GetEnvironmentVariables: document target param and dictionary return - SetEnvironmentVariable: document variableName, value, and target params - GetPath: document target param and list return with platform delimiter info - AddToPath: document pathToAdd and target params with platform delimiter info 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a2bcc35 commit fcb8f53

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,74 @@
11
namespace ModularPipelines.Context;
22

3+
/// <summary>
4+
/// Provides functionality for reading and modifying environment variables.
5+
/// This interface abstracts access to system environment variables, allowing retrieval
6+
/// and modification of variables at different scopes (process, user, or machine level).
7+
/// </summary>
38
public interface IEnvironmentVariables
49
{
10+
/// <summary>
11+
/// Gets the value of the specified environment variable.
12+
/// </summary>
13+
/// <param name="name">The name of the environment variable to retrieve.</param>
14+
/// <param name="target">
15+
/// The target scope from which to retrieve the environment variable.
16+
/// Defaults to <see cref="EnvironmentVariableTarget.Process"/>.
17+
/// </param>
18+
/// <returns>
19+
/// The value of the environment variable specified by <paramref name="name"/>,
20+
/// or <c>null</c> if the environment variable is not found.
21+
/// </returns>
522
string? GetEnvironmentVariable(string name, EnvironmentVariableTarget target = EnvironmentVariableTarget.Process);
623

24+
/// <summary>
25+
/// Gets all environment variables as a dictionary.
26+
/// </summary>
27+
/// <param name="target">
28+
/// The target scope from which to retrieve environment variables.
29+
/// Defaults to <see cref="EnvironmentVariableTarget.Process"/>.
30+
/// </param>
31+
/// <returns>
32+
/// A dictionary containing all environment variable names and their values
33+
/// for the specified target scope.
34+
/// </returns>
735
IDictionary<string, string> GetEnvironmentVariables(EnvironmentVariableTarget target = EnvironmentVariableTarget.Process);
836

37+
/// <summary>
38+
/// Sets the value of an environment variable.
39+
/// </summary>
40+
/// <param name="variableName">The name of the environment variable to set.</param>
41+
/// <param name="value">The value to assign to the environment variable.</param>
42+
/// <param name="target">
43+
/// The target scope in which to set the environment variable.
44+
/// Defaults to <see cref="EnvironmentVariableTarget.Process"/>.
45+
/// </param>
946
void SetEnvironmentVariable(string variableName, string value, EnvironmentVariableTarget target = EnvironmentVariableTarget.Process);
1047

48+
/// <summary>
49+
/// Gets the PATH environment variable as a list of individual paths.
50+
/// The PATH variable is split using the platform-appropriate delimiter
51+
/// (semicolon on Windows, colon on Unix-like systems).
52+
/// </summary>
53+
/// <param name="target">
54+
/// The target scope from which to retrieve the PATH variable.
55+
/// Defaults to <see cref="EnvironmentVariableTarget.Process"/>.
56+
/// </param>
57+
/// <returns>
58+
/// A read-only list of paths from the PATH environment variable.
59+
/// Returns an empty list if the PATH variable is not set.
60+
/// </returns>
1161
IReadOnlyList<string> GetPath(EnvironmentVariableTarget target = EnvironmentVariableTarget.Process);
1262

63+
/// <summary>
64+
/// Adds a path to the PATH environment variable.
65+
/// The path is appended using the platform-appropriate delimiter
66+
/// (semicolon on Windows, colon on Unix-like systems).
67+
/// </summary>
68+
/// <param name="pathToAdd">The path to add to the PATH environment variable.</param>
69+
/// <param name="target">
70+
/// The target scope in which to modify the PATH variable.
71+
/// Defaults to <see cref="EnvironmentVariableTarget.Process"/>.
72+
/// </param>
1373
void AddToPath(string pathToAdd, EnvironmentVariableTarget target = EnvironmentVariableTarget.Process);
1474
}

0 commit comments

Comments
 (0)