NDepend.API Documentation
TryGetEnvVarDirectoryPath(String,IEnvVarDirectoryPath,String) Method
NDepend.Path Namespace > PathHelpers Class > TryGetEnvVarDirectoryPath Method : TryGetEnvVarDirectoryPath(String,IEnvVarDirectoryPath,String) Method
Represents the path.
If this method returns true, this is the returned path object.
If this method returns false, this is the plain english description of the failure.
Try get a new IEnvVarDirectoryPath object from this string.
Syntax
[Extension()]
public static bool TryGetEnvVarDirectoryPath( 
   string pathString,
   out IEnvVarDirectoryPath envVarDirectoryPath,
   out string failureReason
)

Parameters

pathString
Represents the path.
envVarDirectoryPath
If this method returns true, this is the returned path object.
failureReason
If this method returns false, this is the plain english description of the failure.

Return Value

true if pathString is a valid directory path prefixed with an environment variable and as a consequence, the returned envVarDirectoryPath is not null.
Remarks
The path represented by this string doesn't need to exist for this operation to complete properly. The environment variable prefixing the path doesn't need to exist for this operation to complete properly.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

PathHelpers Class
PathHelpers Members
Overload List