protected override void ProcessRecord()
        {
            var manager = new ScriptCSSessionManager();

            var sessionNamesToReturn = manager.GetMatchingSessionNames(Session);
            sessionNamesToReturn.ToList().ForEach(WriteObject);
        }
 protected override void BeginProcessing()
 {
     _manager = new ScriptCSSessionManager();
 }
 private void ExecuteInSession(ScriptCSSessionManager manager, string sessionName)
 {
     var session = manager.GetOrCreate(sessionName, this);
     Execute(session);
 }
 protected override void ProcessRecord()
 {
     var manager = new ScriptCSSessionManager();
     if (null != Session)
     {
         var sessions = manager.GetMatchingSessions(Session);
         if (sessions.Any())
         {
             sessions.ToList().ForEach(Execute);
         }
         else
         {
             Session.ToList().ForEach( s=>ExecuteInSession( manager, s ));
         }
     }
     else
     {
         ExecuteInSession(manager, DefaultSessionName);
     }
 }