public static string GetEnvironmentVariable(this IProcessManager processManager, int pid, string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }
            var found = processManager.GetEnvironmentVariables(pid,
                                                               _ => name.Equals(_.Key, StringComparison.OrdinalIgnoreCase));

            return(found.Any() ? found.Single().Value : string.Empty);
        }
 public static IDictionary <string, string> GetEnvironmentVariables(this IProcessManager processManager, int pid)
 {
     return(processManager.GetEnvironmentVariables(pid, null));
 }