Exemplo n.º 1
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            Session s = new Session();

            SessionSettings sessionSettings = new SessionSettings();

            sessionSettings.ClassOfService  = ClassOfService.General;
            sessionSettings.IsoLanguage     = "en-US";
            sessionSettings.ApplicationName = "i3lets";

            HostSettings hostSettings = new HostSettings();

            hostSettings.HostEndpoint = new HostEndpoint(Host, HostEndpoint.DefaultPort);

            AuthSettings authSettings;

            if (String.IsNullOrEmpty(UserName) || Password == null)
            {
                authSettings = new WindowsAuthSettings();
            }
            else
            {
                authSettings = new ICAuthSettings(UserName, Password);
            }

            StationSettings stationSettings = new StationlessSettings();

            s.Connect(sessionSettings, hostSettings, authSettings, stationSettings);

            StaticDataStore.AddSession(s);

            WriteObject(s);
        }
Exemplo n.º 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            foreach (Session session in Session)
            {
                StaticDataStore.RemoveSession(session);
                session.Disconnect();
            }
        }
Exemplo n.º 3
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (SessionId >= 0)
            {
                WriteObject(StaticDataStore.GetSession(SessionId));
            }
            else
            {
                foreach (Session session in StaticDataStore.GetAllSessions())
                {
                    WriteObject(session, true);
                }
            }
        }