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;
}