0
我需要做的是这样的:IHttpActionResult超时等待的PowerShell脚本
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#任务仍将继续,并将发送第二封电子邮件,否则任务将停止,并且不会发送电子邮件。