AzureML.PowerShell.ExportAmlWebServiceDefinitionFromExperiment.ProcessRecord C# (CSharp) Method

ProcessRecord() protected method

protected ProcessRecord ( ) : void
return void
        protected override void ProcessRecord()
        {
            string rawJson = string.Empty;
            Experiment exp = Sdk.GetExperimentById(GetWorkspaceSetting(), ExperimentId, out rawJson);
            if (exp.Status.StatusCode != "Finished")
              throw new Exception("Experiment must be in Finished state. The current state is: " + exp.Status.StatusCode);
            else
            {
                string output = Sdk.ExportAmlWebServiceDefinitionFromExperiment(GetWorkspaceSetting(), ExperimentId);
                File.WriteAllText(OutputFile, output);
                WriteObject(string.Format("Experiment graph exported to file \"{0}\"", OutputFile));
            }
        }
    }
ExportAmlWebServiceDefinitionFromExperiment