Exemple #1
0
        /// <summary>
        /// Triggered when data arrived from the pipeline
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="arg"></param>
        void poshEngine_PipelineOutputReceived(object sender, PipelineOutputEventArg arg)
        {
            // Get the base object from pipeline output, convert it to string
            string result = arg.PSObjectOutput.BaseObject.ToString();

            // Invoke SetResult Method
            this.Dispatcher.Invoke(new Action(() => SetResult(result)));
        }
 private void _shell_PipelineOutputReceived(object sender, PipelineOutputEventArg arg)
 {
     Dispatcher.Invoke(() =>
     {
         string result  = arg.PSObjectOutput.BaseObject.ToString();
         TbOutput.Text += "\r\n" + result;
     });
 }