How to capture error/warning/success from powershell in c#?


hi,

i'm writing small tool collect detail office 365 using powershell in c#.

challenge i'm facing is, after powershell command run, want know whether successful or not. if not , warning or error.

"if  errors.count > 0" me understand failed , "if  errors.count == 0" tell me there issue.

the concern is, need clear error, before running every command to use above logic find success or failure of recent command, there other better method do have? if , can please share it.

secondly how find/capture warning?

thank in advance.

hi,

how running these powershell commands c# code?

can post example?


marcus björklund

in order others find relevant information, please mark/propose answers and/or vote posts helpful, appropriate.



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

SQL Server 2008 - High Memory Usage

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

Problem In Configuring Biztalk 2009 In Creating A ReceivePort.When I Try To Create A Receive POrt I Got This Error