private void ExecutePowershell(String powershellFile)
{
String exec = "powershell.exe";
String args = String.Format("-NonInteractive -File {0}", powershellFile);
EucaLogger.Debug(String.Format("Executing {0} {1}", exec, args));
try
{
Win32_CommandResult result = SystemsUtil.SpawnProcessAndWait(exec, args);
EucaLogger.Debug(String.Format("Execution finished with exit code={0}", result.ExitCode));
EucaLogger.Debug(String.Format("Stdout: {0}", result.Stdout));
EucaLogger.Debug(String.Format("Stderr: {0}", result.Stderr));
}
catch (Exception ex)
{
EucaLogger.Exception("Execution failed", ex);
}
}