Example #1
0
 private void InitializeSessionVars()
 {
     PSAlert = new psmethods.PSAlert(frm);
     PSRoot = new psvariables.PSRoot("PSRoot");
     PSStatus = new psmethods.PSStatus(frm, scriptlvw);
     PSModRoot = new psvariables.PSModRoot("PSModRoot");
     PSFramework = new psvariables.PSFramework("PSFramework");
     PSMessageBox = new psmethods.PSMessageBox();
     rspace.SessionStateProxy.PSVariable.Set(PSRoot);
     rspace.SessionStateProxy.PSVariable.Set(PSModRoot);
     rspace.SessionStateProxy.PSVariable.Set(PSFramework);
     rspace.SessionStateProxy.SetVariable("PSMessageBox", PSMessageBox);
     rspace.SessionStateProxy.SetVariable("PSAlert", PSAlert);
     rspace.SessionStateProxy.SetVariable("PSStatus", PSStatus);
 }
Example #2
0
 private void InitializeSessionVars()
 {
     if (rspace.RunspaceAvailability == RunspaceAvailability.Available)
     {
         PSAlert = new psmethods.PSAlert(frm);
         PSRoot = new psvariables.PSRoot("PSRoot");
         PSStatus = new psmethods.PSStatus(frm, scriptlvw);
         PSModRoot = new psvariables.PSModRoot("PSModRoot");
         PSFramework = new psvariables.PSFramework("PSFramework");
         PSMessageBox = new psmethods.PSMessageBox();
         PSTab = new psmethods.PSTab(frm);
         PSHosts = new psmethods.PSHosts(frm);
         rspace.SessionStateProxy.PSVariable.Set(PSRoot);
         rspace.SessionStateProxy.PSVariable.Set(PSModRoot);
         rspace.SessionStateProxy.PSVariable.Set(PSFramework);
         rspace.SessionStateProxy.SetVariable("PSMessageBox", PSMessageBox);
         rspace.SessionStateProxy.SetVariable("PSAlert", PSAlert);
         rspace.SessionStateProxy.SetVariable("PSStatus", PSStatus);
         rspace.SessionStateProxy.SetVariable("PSHosts", PSHosts);
         rspace.SessionStateProxy.SetVariable("PSTab", PSTab);
     }
 }