Skip to content

Instantly share code, notes, and snippets.

View MrBean2016's full-sized avatar

Hans Håkansson MrBean2016

  • Synapsei AB
  • Sweden
View GitHub Profile
@AlexMAS
AlexMAS / ProcessAsyncHelper.cs
Last active July 18, 2024 20:58
The right way to run external process in .NET (async version)
using System;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
public static class ProcessAsyncHelper
{
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout)
{
var result = new ProcessResult();