internal static ScriptingInfo ReadScriptingInfo(string filename) { LOG.Info("Reading scripting info from file {0}", filename); Stream stream = File.Open(filename, FileMode.Open); using (TextReader streamReader = new StreamReader(stream)) { XmlSerializer ser = new XmlSerializer(typeof(ScriptingInfo)); ScriptingInfo scriptingInfo = (ScriptingInfo)ser.Deserialize(streamReader); int count = scriptingInfo != null && scriptingInfo.OperationInfo != null ? scriptingInfo.OperationInfo.Length : 0; LOG.Info("{0} operation definition(s) read", count); return(scriptingInfo); } }
public Scripting(string configurationFile, IPowerShellSupport powershell) { if (configurationFile != null) { _scriptingInfo = PersistenceUtility.ReadScriptingInfo(configurationFile); _scriptingInfo.ReadFiles(); } _powershell = powershell; }