Forum Discussion
Unable to open Intune App Utility
@Oliver Kieselbach Is there way to read the output message from tool during conversion process in c#?. Please refer the attached screenshot.
I have tried couple of sample examples but wasn't successful.
Thanks in advance.
Hi Sangamesh_gouri,
this can be accomplished by redirecting StandardOut and StandardError This way you can easily start a process and get all output back to your .NET program.
That's what you are looking for:
best,
Oliver
- Sangamesh GouriMar 04, 2020Copper Contributor
Oliver Kieselbach Thanks for the link . i have tried example from msdn link provided by you. But still it is not updating the console output. Please find the attached screen shot for error message below is code i tried along few other samples i analyzed.
namespace ConsoleApplication1
{
using System;
using System.Diagnostics;
using System.Threading.Tasks;class Program
{
static void Main(string[] args)
{
string source = @"D:\Packages\MSIs\7zip920X64\";
string primary = @"D:\Packages\MSIs\7zip920X64\7z920-x64.msi";
string output = @"D:\Packages\MSIs\7zip920X64\Output";
string arguments = $@"-c ""{source}"" -s ""{primary}"" -o ""{output}"" -q";
string toolPath = "C:\\Current\\Common\\Tools\\IntuneWinConverter\\IntuneWinAppUtil.exe";
using (Process compiler = new Process())
{
compiler.StartInfo.FileName = toolPath;
compiler.StartInfo.Arguments = arguments;
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();Console.WriteLine(compiler.StandardOutput.ReadToEnd());
compiler.WaitForExit();
}Console.ReadLine();
}
}
}