public FullHost(bool interactive) { _interactive = interactive; LocalHost = new LocalHost(true); _currentRunspace = RunspaceFactory.CreateRunspace(LocalHost); _currentRunspace.Open(); _ctrlStmtKeywordLength = Parser.ControlStatementKeywords.Max(s => s.Length); LoadProfiles(); }
public FullHost() { myHost = new LocalHost(); myRunSpace = RunspaceFactory.CreateRunspace(myHost); myRunSpace.Open(); string exePath = Assembly.GetCallingAssembly().Location; string configPath = Path.Combine(Path.GetDirectoryName(exePath), "config.ps1"); Execute(configPath); }
public FullHost(bool interactive) { _interactive = interactive; LocalHost = new LocalHost(true); _currentRunspace = RunspaceFactory.CreateRunspace(LocalHost); _currentRunspace.Open(); // TODO: check user directory for a config script and fall back to the default one of the installation // need to use .CodeBase property, as .Location gets the wrong path if the assembly was shadow-copied var localAssemblyPath = new Uri(Assembly.GetCallingAssembly().CodeBase).LocalPath; Execute(FormatConfigCommand(localAssemblyPath)); }
public LocalHostUserInterface(LocalHost parent) { UseUnixLikeInput = Environment.OSVersion.Platform != System.PlatformID.Win32NT && Console.WindowWidth > 0; _parentHost = parent; // Set up the control-C handler. try { Console.CancelKeyPress += new ConsoleCancelEventHandler(HandleControlC); Console.TreatControlCAsInput = false; } catch (IOException) { // don't mind. if it doesn't work we're likely in a condition where stdin/stdout was redirected } }
public LocalHostUserInterface(LocalHost parent) { UseUnixLikeInput = Environment.OSVersion.Platform != System.PlatformID.Win32NT && Console.WindowWidth > 0; _parentHost = parent; // Set up the control-C handler. try { Console.CancelKeyPress += new ConsoleCancelEventHandler(HandleControlC); Console.TreatControlCAsInput = false; } catch (IOException) { // don't mind. if it doesn't work we're likely in a condition where stdin/stdout was redirected } }
public static Runspace CreateRunspace(InitialSessionState initialSessionState) { PSHost host = new LocalHost(); // DefaultHost(Thread.CurrentThread.CurrentCulture, Thread.CurrentThread.CurrentUICulture); return RunspaceFactory.CreateRunspace(host, initialSessionState); }
protected LocalHostUserInterface() { UseUnixLikeInput = false; _parentHost = null; InteractiveIO = false; }
protected LocalHostUserInterface() { UseUnixLikeInput = false; _parentHost = null; InteractiveIO = false; }