Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ResolvePath C# (CSharp) Method

ResolvePath() public static method

public static ResolvePath ( this psCmdlet, string path ) : string
psCmdlet this
path string
return string
        public static string ResolvePath(this PSCmdlet psCmdlet, string path)
        {
            if (path == null)
            {
                return null;
            }

            if (psCmdlet.SessionState == null)
            {
                return path;
            }

            var result = psCmdlet.SessionState.Path.GetResolvedPSPathFromPSPath(path);
            string fullPath = string.Empty;

            if (result != null && result.Count > 0)
            {
                fullPath = result[0].Path;
            }

            return fullPath;
        }