Skip to content

Instantly share code, notes, and snippets.

@monkekode
Last active February 18, 2022 10:09
Show Gist options
  • Save monkekode/49883693f359d26c67651a3d1aebafee to your computer and use it in GitHub Desktop.
Save monkekode/49883693f359d26c67651a3d1aebafee to your computer and use it in GitHub Desktop.
using System;
using System.Diagnostics;
using Gapotchenko.FX.Diagnostics;
using Newtonsoft.Json;
namespace GetProcessEnv
{
internal static class Program
{
public static void Main(string[] args)
{
var process = Process.GetProcessById(int.Parse(args[0]));
var env = process.ReadEnvironmentVariables();
Console.WriteLine(JsonConvert.SerializeObject(env));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment