private bool LoadHistory() { if (null != _history) { return(false); } _history = new HistoryStack(); IEnumerable <ErrorRecord> error; var items = _executor.ExecuteCommand("get-history", out error, ExecutionOptions.DoNotRaisePipelineException); if (null == items) { return(false); } items.ToList().ForEach( item => { var o = item.BaseObject ?? item; if (null == o) { return; } _history.Add(o.ToString()); }); _index = _history.Count; return(true); }
private bool LoadHistory() { if (null != _history) { return false; } _history = new HistoryStack(); IEnumerable<ErrorRecord> error; var items = _executor.ExecuteCommand("get-history", out error, ExecutionOptions.DoNotRaisePipelineException); if (null == items) { return false; } items.ToList().ForEach( item => { var o = item.BaseObject ?? item; if (null == o) { return; } _history.Add(o.ToString()); }); _index = _history.Count; return true; }