【发布时间】:2017-03-23 15:08:11
【问题描述】:
我需要做类似的事情:
public IHttpActionResult StartArchiving(string machineName)
{
//Email users to notice them an archiving started on their machine
EmailHelper.SendEmail(some params);
//powershell scripting call could extends up to 2-3 hours maybe
var answere = PowerShell.Archive(machineName);
//Email users to notice them the archiving has stopped on their machine
EmailHelper.SendEmail(some params);
}
发送第一封邮件后,任务可以持续很长时间。 完成 Powershell 脚本后,C# 任务将继续运行并发送第二封电子邮件,否则任务将停止且不发送电子邮件。
【问题讨论】:
标签: c# powershell timeout